优化 token 处理逻辑,统一 createCookie 调用格式,返回 token 过期时间

This commit is contained in:
2026-02-02 17:02:20 +08:00
parent a0f0f65d20
commit 82e3392b36
5 changed files with 55 additions and 27 deletions

View File

@@ -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');
}