lrf402788946 4 years ago
parent
commit
7638ad2af9
1 changed files with 2 additions and 1 deletions
  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);
   }