diff --git a/functions/admin.js b/functions/admin.js new file mode 100644 index 00000000..893bad07 --- /dev/null +++ b/functions/admin.js @@ -0,0 +1,15 @@ +export async function onRequest(context) { + // 重定向到/dashboard + const { + request, // same as existing Worker API + env, // same as existing Worker API + params, // if filename includes [id] or [[path]] + waitUntil, // same as ctx.waitUntil in existing Worker API + next, // used for middleware or to fetch assets + data, // arbitrary space for passing data between middlewares + } = context; + //get the request url + const url = new URL(request.url); + //redirect to dashboard page + return Response.redirect(url.origin+"/dashboard", 302) +} \ No newline at end of file