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
2025-03-29 20:26:20 +08:00

14 lines
387 B
TypeScript

import { type NextRequest, NextResponse } from "next/server"
export async function GET(request: NextRequest) {
// 生成1到50之间的随机ID
const randomId = Math.floor(Math.random() * 50) + 1
// 构建随机图片URL
const randomImageUrl = `https://zh.yuazhi.cn/at410/random/${randomId}.jpg`
// 重定向到随机图片
return NextResponse.redirect(randomImageUrl)
}