Commit e440142c authored by 李尚科's avatar 李尚科

fix

parent 45c5da32
Pipeline #14064 passed with stage
in 5 seconds
......@@ -27,7 +27,7 @@ class UserController extends Controller {
//存储缓存标识
const user_uuid = user.uuid;
const key = 'course_user_session_' + user_uuid;
await app.memcache.set(key, { user_uuid, openid }, 86400);
await app.memcache.set(key, { user_uuid, openid }, 86400 * 180);
const auth_token = ctx.helper.md5(openid + user_uuid + 'jbwl');
ctx.set('uuid', key);
ctx.set('auth_token', auth_token);
......
......@@ -8,15 +8,15 @@ module.exports = (options, app) => {
const key = 'course_user_session_' + uuid;
const auth_info = await ctx.app.memcache.get(key);
if (!auth_info) {
await next();
return;
// ctx.failed('login auth error');
// await next();
// return;
ctx.failed('login auth error');
}
const openid = auth_info.openid;
const user_uuid = auth_info.user_uuid;
const auth_token = ctx.headers.auth_token;
if (ctx.helper.md5(openid + uuid + 'jbwl') != auth_token) {
// ctx.failed('login auth error');
ctx.failed('login auth error');
}
ctx.setUserUuid(user_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