mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
fix rejudge, add cache
This commit is contained in:
1 parent
c68953c59f
commit
4c53fc8146
7 files changed
+103
-103
No files matched your search
@@ -44,6 +44,10 @@ MIDDLEWARE(async (ctx, next) => {
|
||||
}
|
||||
}
|
||||
};
|
||||
ctx.back = () => {
|
||||
console.log(122143);
|
||||
ctx.redirect(ctx.request.headers.referer || '/');
|
||||
};
|
||||
ctx.csrf_token = await token.add(token.TYPE_CSRF_TOKEN, 600, ctx.path);
|
||||
await next();
|
||||
if (ctx.session.sid)
|
||||
@@ -58,7 +62,7 @@ MIDDLEWARE(async (ctx, next) => {
|
||||
update_ip: ctx.request.ip,
|
||||
update_ua: ctx.request.headers['user-agent'] || ''
|
||||
}, ctx.session));
|
||||
let cookie = { secure: options.session.secure, httponly: true };
|
||||
let cookie = { secure: options.session.secure };
|
||||
if (save) {
|
||||
cookie.expires = ctx.session.expireAt, cookie.maxAge = expireSeconds;
|
||||
ctx.cookies.set('save', 'true', cookie);
|
||||
|
||||
Reference in new issue
Block a user