liuyu před 4 roky
rodič
revize
1c98b58caa
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      app/service/weixin.js

+ 2 - 2
app/service/weixin.js

@@ -74,8 +74,8 @@ class WeixinAuthService extends AxiosService {
       this.ctx.logger.error(`[WeixinAuthService] fetch userinfo by openid fail, errcode: ${res.errcode}, errmsg: ${res.errmsg}`);
       throw new BusinessError(ErrorCode.SERVICE_FAULT, '获得微信用户信息失败');
     }
-    const token = res.access_token;
-    console.log(res);
+    const token = res.data.access_token;
+    console.log(token);
     const urlun = 'https://api.weixin.qq.com/cgi-bin/user/info?access_token=' + token + '&openid=' + openid + '&lang=zh_CN';
     const result = await this.ctx.curl(urlun, {
       method: 'get',