lrf402788946 4 yıl önce
ebeveyn
işleme
4b1d53f765
1 değiştirilmiş dosya ile 9 ekleme ve 9 silme
  1. 9 9
      app/service/weixin.js

+ 9 - 9
app/service/weixin.js

@@ -65,9 +65,9 @@ class WeixinAuthService extends AxiosService {
     }
     // 获取微信的用户信息
     console.log({ access_token, appid, openid });
-    const res = await this.httpGet('https://api.weixin.qq.com/cgi-bin/user/info?lang=zh_CN', { access_token, appid, openid });
-    const object = _.pick(res, [ 'nickname', 'headimgurl', 'openid' ]); // 昵称,头像,openid
-    console.log(object);
+    // const res = await this.httpGet('https://api.weixin.qq.com/cgi-bin/user/info?lang=zh_CN', { access_token, appid, openid });
+    // const object = _.pick(res, [ 'nickname', 'headimgurl', 'openid' ]); // 昵称,头像,openid
+    // console.log(object);
     // 验证获取openid结束,接下来应该返回前端
     const key = `${this.prefix}${state}`;
     let fqueries = await this.app.redis.get(key);
@@ -78,12 +78,12 @@ class WeixinAuthService extends AxiosService {
     if (groupid) {
       if (type === 'group') {
         // TODO加用户,进组
-        const udata = { name: object.nickname, icon: object.headimgurl, openid: object.openid, groupid };
-        try {
-          await this.ctx.service.patient.create(udata);
-        } catch (error) {
-          this.logger.error(error);
-        }
+        // const udata = { name: object.nickname, icon: object.headimgurl, openid: object.openid, groupid };
+        // try {
+        //   await this.ctx.service.patient.create(udata);
+        // } catch (error) {
+        //   this.logger.error(error);
+        // }
         redirect_uri = `${this.ctx.app.config.baseUrl}/mobile`;
       } else {
         // TODO 点击进入群组聊天,不过没改也没加