mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
Make a super simple shortforward.ts system for yhw.tw/news
This commit is contained in:
parent
5b5475f74c
commit
a998a99901
1 changed files with 14 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue