|
@@ -62,10 +62,6 @@ class WeixinAuthService extends AxiosService {
|
|
|
this.ctx.logger.error(JSON.stringify(req.data));
|
|
|
throw new BusinessError(ErrorCode.SERVICE_FAULT, '未获取到openid');
|
|
|
}
|
|
|
-
|
|
|
- const res = await this.httpGet('/api.weixin.qq.com/cgi-bin/user/info?lang=zh_CN', { appid, openid });
|
|
|
- const object = _.pick(res, [ 'nickname', 'headimgurl', 'openid' ]);
|
|
|
- console.log('已获取用户信息');
|
|
|
|
|
|
const key = `${this.prefix}${state}`;
|
|
|
let fqueries = await this.app.redis.get(key);
|
|
@@ -75,7 +71,11 @@ class WeixinAuthService extends AxiosService {
|
|
|
|
|
|
if (groupid) {
|
|
|
if (type === 'group') {
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+ const res = await this.httpGet('/api.weixin.qq.com/cgi-bin/user/info?lang=zh_CN', { appid, openid });
|
|
|
+ const object = _.pick(res, [ 'nickname', 'headimgurl', 'openid' ]);
|
|
|
+ console.log('已获取用户信息');
|
|
|
const udata = { name: object.nickname, icon: object.headimgurl, openid: object.openid, groupid };
|
|
|
try {
|
|
|
await this.ctx.service.patient.create(udata);
|