优化 token 处理逻辑,统一 createCookie 调用格式,返回 token 过期时间
This commit is contained in:
@@ -109,7 +109,9 @@ app
|
||||
const token = JSON.parse(data);
|
||||
if (token.accessToken) {
|
||||
ctx.body = token;
|
||||
createCookie(token, ctx);
|
||||
createCookie({
|
||||
token: token.accessToken,
|
||||
}, ctx);
|
||||
} else {
|
||||
ctx.throw(500, 'Checked error Failed, login failed, please login again');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user