Commit 8db9062e authored by 任国军's avatar 任国军

fix token bug

parent 44491272
Pipeline #21920 passed with stage
in 3 seconds
...@@ -92,9 +92,9 @@ class UserService extends Service { ...@@ -92,9 +92,9 @@ class UserService extends Service {
session_key: '', session_key: '',
phone, phone,
}; };
await ctx.app.memcache.set(key, value); await ctx.app.memcache.set(key, value, 7 * 24 * 3600);
const authToken = await this.service.jwt.apply({ user_uuid: userInfo.uuid, openid: userInfo.openid }); const authToken = await this.service.jwt.apply({ user_uuid: userInfo.uuid, openid: userInfo.openid });
await app.memcache.set('course_auth_token_' + userInfo.uuid, authToken); await app.memcache.set('course_auth_token_' + userInfo.uuid, authToken, 7 * 24 * 3600);
const ret = { const ret = {
user_uuid: userInfo.uuid, user_uuid: userInfo.uuid,
...@@ -135,9 +135,9 @@ class UserService extends Service { ...@@ -135,9 +135,9 @@ class UserService extends Service {
session_key, session_key,
phone: userInfo.phone, phone: userInfo.phone,
}; };
await app.memcache.set(key, value); await app.memcache.set(key, value, 7 * 24 * 3600);
const authToken = await this.service.jwt.apply({ user_uuid: userInfo.uuid, openid: userInfo.openid }); const authToken = await this.service.jwt.apply({ user_uuid: userInfo.uuid, openid: userInfo.openid });
await app.memcache.set('course_auth_token_' + userInfo.uuid, authToken); await app.memcache.set('course_auth_token_' + userInfo.uuid, authToken, 7 * 24 * 3600);
const ret = { const ret = {
user_uuid: userInfo.uuid, user_uuid: userInfo.uuid,
...@@ -225,9 +225,9 @@ class UserService extends Service { ...@@ -225,9 +225,9 @@ class UserService extends Service {
session_key: ctx.isEmpty(userSession) ? '' : userSession.session_key, session_key: ctx.isEmpty(userSession) ? '' : userSession.session_key,
phone: data.phone, phone: data.phone,
}; };
await app.memcache.set(key, value); await app.memcache.set(key, value, 7 * 24 * 3600);
const authToken = await this.service.jwt.apply({ user_uuid: data.uuid, openid: user.openid }); const authToken = await this.service.jwt.apply({ user_uuid: data.uuid, openid: user.openid });
await app.memcache.set('course_auth_token_' + data.uuid, authToken); await app.memcache.set('course_auth_token_' + data.uuid, authToken, 7 * 24 * 3600);
const ret = { const ret = {
user_uuid: data.uuid, user_uuid: data.uuid,
......
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