|
@@ -65,9 +65,9 @@ class WeixinAuthService extends AxiosService {
|
|
}
|
|
}
|
|
// 获取微信的用户信息
|
|
// 获取微信的用户信息
|
|
console.log({ access_token, appid, openid });
|
|
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结束,接下来应该返回前端
|
|
// 验证获取openid结束,接下来应该返回前端
|
|
const key = `${this.prefix}${state}`;
|
|
const key = `${this.prefix}${state}`;
|
|
let fqueries = await this.app.redis.get(key);
|
|
let fqueries = await this.app.redis.get(key);
|
|
@@ -78,12 +78,12 @@ class WeixinAuthService extends AxiosService {
|
|
if (groupid) {
|
|
if (groupid) {
|
|
if (type === 'group') {
|
|
if (type === 'group') {
|
|
// TODO加用户,进组
|
|
// 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`;
|
|
redirect_uri = `${this.ctx.app.config.baseUrl}/mobile`;
|
|
} else {
|
|
} else {
|
|
// TODO 点击进入群组聊天,不过没改也没加
|
|
// TODO 点击进入群组聊天,不过没改也没加
|