3 Commits

Author SHA1 Message Date
zhhe aa1981953d [fix] fix the random url 2025-10-21 18:15:34 +08:00
zhhe 45b09e41f5 chore:update 410 data 2025-10-04 17:39:09 +08:00
zhhe a4a91ac911 1.6:new home page
Reviewed-on: http://code.zhhe.dev/spircape/api/pulls/2
2025-10-01 13:00:04 +08:00
+2 -2
View File
@@ -1,10 +1,10 @@
import { type NextRequest, NextResponse } from "next/server" import { type NextRequest, NextResponse } from "next/server"
export async function GET(request: NextRequest) { export async function GET(request: NextRequest) {
// 生成1到50之间的随机ID // 随机ID
const randomId = Math.floor(Math.random() * 100) + 1 const randomId = Math.floor(Math.random() * 100) + 1
// 构建随机图片URL // 构建随机图片URL
const randomImageUrl = `https://zh.yuazhi.cn/at410/random/${randomId}.jpg` const randomImageUrl = `https://box.zh.yuazhi.cn/410/random/${randomId}.jpg`
// 重定向到随机图片 // 重定向到随机图片
return NextResponse.redirect(randomImageUrl) return NextResponse.redirect(randomImageUrl)