mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 15:51:01 +08:00
Make a super simple shortforward.ts system for yhw.tw/news
This commit is contained in:
parent
5b5475f74c
commit
a998a99901
14
server/routes/shortforward.ts
Normal file
14
server/routes/shortforward.ts
Normal 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)
|
||||||
|
})
|
Loading…
x
Reference in New Issue
Block a user