Make a super simple shortforward.ts system for yhw.tw/news

This commit is contained in:
yuanhau 2025-05-27 14:33:05 +08:00
parent 5b5475f74c
commit a998a99901

View file

@ -0,0 +1,14 @@
export default defineEventHandler((event) => {
const query = getQuery(event);
const toolCall = query.tool;
const forwardCall = query.forward;
if (toolCall) {
const buildUrl = "/desktop?openapp=" + toolCall;
return sendRedirect(event, buildUrl, 302);
}
if (forwardCall) {
const buildUrl = "/" + forwardCall;
return sendRedirect(event, buildUrl, 302);
}
return sendRedirect(event, "/", 302)
})