|
@@ -179,13 +179,13 @@ class WeixinController extends Controller {
|
|
|
async appAuth() {
|
|
|
console.warn('in appAuth');
|
|
|
const { js_code, login = true } = this.ctx.query;
|
|
|
+ console.log(js_code);
|
|
|
const appopenid = await this.ctx.service.weixin.appAuth(js_code);
|
|
|
if (!login) this.ctx.ok(appopenid);
|
|
|
- console.warn('-------');
|
|
|
console.warn(`openid=>${appopenid}`);
|
|
|
- const state = uuid();
|
|
|
- const key = `appinfo:${state}`;
|
|
|
- await this.app.redis.set(key, appopenid, 'EX', 600);
|
|
|
+ // const state = uuid();
|
|
|
+ // const key = `appinfo:${state}`;
|
|
|
+ // await this.app.redis.set(key, appopenid, 'EX', 600);
|
|
|
const res = await this.ctx.service.user.findByAppOpenid(appopenid);
|
|
|
const obj = { user: res, openid: appopenid };
|
|
|
this.ctx.ok(obj);
|