feat(auth): 登录态改为滑动续期(后台 24h/7d,打手 7d/30d)
This commit is contained in:
@@ -24,6 +24,11 @@ export function createCorsMiddleware(
|
||||
'Content-Type, Authorization, X-Shop-Token, X-Poll-Token',
|
||||
)
|
||||
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE, OPTIONS')
|
||||
// 前端靠这两个响应头同步滑动续期后的到期时间。
|
||||
res.setHeader(
|
||||
'Access-Control-Expose-Headers',
|
||||
'X-Session-Expires-At, X-Session-Absolute-Expires-At',
|
||||
)
|
||||
res.setHeader('Access-Control-Max-Age', '86400')
|
||||
|
||||
if (req.method === 'OPTIONS') {
|
||||
|
||||
Reference in New Issue
Block a user