This commit is contained in:
toom1996
2025-06-26 14:18:22 +08:00
parent 2be1ccf1d5
commit 945bb01109
3 changed files with 402 additions and 3 deletions

View File

@ -3,7 +3,8 @@ import { websiteConfig } from "../../utils/rpc";
export async function onRequest (context: any, next: any) {
// 拦截一个请求里的数据
console.log('middleware')
// 拦截一个请求里的数据
// 可选地修改 `locals` 中的属性
const host = await getHost(context.request);
@ -12,7 +13,6 @@ export async function onRequest (context: any, next: any) {
return next();
}
// 防止无线跳转
if (context.locals.is_write) {
return next();