Merge pull request #909 from cmliu/beta2.0

fix: 向下兼容UUID路径跳转登录页面
This commit is contained in:
CMLiussss
2026-01-12 23:57:06 +08:00
committed by GitHub

View File

@@ -184,7 +184,7 @@ export default {
ctx.waitUntil(请求日志记录(env, request, 访问IP, 'Admin_Login', config_JSON)); ctx.waitUntil(请求日志记录(env, request, 访问IP, 'Admin_Login', config_JSON));
return fetch(Pages静态页面 + '/admin'); return fetch(Pages静态页面 + '/admin');
} else if (访问路径 === 'logout') {//清除cookie并跳转到登录页面 } else if (访问路径 === 'logout' || uuidRegex.test(访问路径)) {//清除cookie并跳转到登录页面
const 响应 = new Response('重定向中...', { status: 302, headers: { 'Location': '/login' } }); const 响应 = new Response('重定向中...', { status: 302, headers: { 'Location': '/login' } });
响应.headers.set('Set-Cookie', 'auth=; Path=/; Max-Age=0; HttpOnly'); 响应.headers.set('Set-Cookie', 'auth=; Path=/; Max-Age=0; HttpOnly');
return 响应; return 响应;