fix: 修复下载证书时提示token已过期的问题

This commit is contained in:
xiaojunnuo
2025-04-19 14:25:56 +08:00
parent 02b6351e13
commit 0e07ae6ce8
9 changed files with 103 additions and 79 deletions
@@ -28,7 +28,7 @@ export class LoginController extends BaseController {
}
private writeTokenCookie(token: { expire: any; token: any }) {
this.ctx.cookies.set("token", token.token, {
this.ctx.cookies.set("certd_token", token.token, {
maxAge: 1000 * token.expire
});
}
@@ -72,5 +72,10 @@ export class LoginController extends BaseController {
}
@Post('/logout', { summary: Constants.per.authOnly })
public logout() {}
public logout() {
this.ctx.cookies.set("certd_token", "", {
maxAge: 0
});
return this.ok();
}
}