lrf402788946 4 年之前
父节点
当前提交
7638ad2af9
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      app/service/wxpay.js

+ 2 - 1
app/service/wxpay.js

@@ -19,13 +19,14 @@ class WxpayService extends CrudService {
 
   async toAuth({ code, id }) {
     const token = await this.redis.get(id);
+    console.log(`token=>${token}`);
     if (token) return;
     const url = ({ id, secret }) => `https://api.weixin.qq.com/sns/jscode2session?appid=${id}&secret=${secret}&js_code=${code}&grant_type=authorization_code`;
     const res = await this.ctx.curl(url(this.appInfo), {
       method: 'get',
       dataType: 'json',
     });
-
+    console.log(`res=>${res}`);
     const info = JSON.stringify(res.data);
     await this.redis.set(id, info, 'EX', 3600);
   }