Commit b5ab652c authored by 任国军's avatar 任国军

wechat login add auth_token

parent cf0c4d1f
Pipeline #22845 passed with stage
in 3 seconds
......@@ -137,13 +137,15 @@ class UserService extends Service {
phone: userInfo.phone,
};
await app.memcache.set(key, value, 7 * 24 * 3600);
// const authToken = await this.service.jwt.apply({ user_uuid: userInfo.uuid, openid: userInfo.openid });
// await app.memcache.set('course_auth_token_' + userInfo.uuid, authToken, 7 * 24 * 3600);
const authToken = ctx.isEmpty(userInfo.phone) ? '' : await this.service.jwt.apply({ user_uuid: userInfo.uuid, openid: userInfo.openid });
if (!ctx.isEmpty(authToken)) {
await app.memcache.set('course_auth_token_' + userInfo.uuid, authToken, 7 * 24 * 3600);
}
const ret = {
user_uuid: userInfo.uuid,
openid: userInfo.openid,
bind_phone: ctx.isEmpty(userInfo.phone) ? 0 : 1,
// auth_token: authToken,
auth_token: authToken,
};
return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment