feat: 管理后台支持 Sub2API 管理员 token 认证
保留原有 ADMIN_TOKEN 认证,同时支持传入 Sub2API 用户 token, 通过 /api/v1/auth/me 验证 role=admin 身份。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,7 @@ const refundSchema = z.object({
|
||||
});
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
if (!verifyAdminToken(request)) return unauthorizedResponse();
|
||||
if (!await verifyAdminToken(request)) return unauthorizedResponse();
|
||||
|
||||
try {
|
||||
const body = await request.json();
|
||||
|
||||
Reference in New Issue
Block a user