liuyu преди 4 години
родител
ревизия
1c98b58caa
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  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',