This repository has been archived on 2025-11-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
api/app/random-410/route.ts

15 lines
385 B
TypeScript
Raw Normal View History

2025-03-29 20:26:20 +08:00
import { type NextRequest, NextResponse } from "next/server"
export async function GET(request: NextRequest) {
2025-04-04 13:26:18 +08:00
// 生成1到50之间的随机ID
const randomId = Math.floor(Math.random() * 100) + 1
// 构建随机图片URL
2025-10-04 17:39:09 +08:00
const randomImageUrl = `https://box.zh.yuazhi.cn/410/note/${randomId}.jpg`
2025-03-29 20:26:20 +08:00
// 重定向到随机图片
return NextResponse.redirect(randomImageUrl)
}
2025-04-04 13:18:17 +08:00