Skip to content

Commit

Permalink
fix: cookie max age
Browse files Browse the repository at this point in the history
  • Loading branch information
wmui committed Jun 27, 2023
1 parent 626a2ca commit 1e3e463
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controller/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ class UserController extends BaseController {
email: admin.email,
});
// 用于get请求验证
this.ctx.cookies.set('Token', token);
this.ctx.cookies.set('Token', token, {
maxAge: 60 * 60 * 24 * 7,
});
// 用于api请求验证
this.success(token);
} else {
Expand Down

0 comments on commit 1e3e463

Please sign in to comment.