统一API Base URL保存与请求时去除末尾斜杠

This commit is contained in:
mtvpls
2026-07-25 10:57:04 +08:00
parent 19f4957160
commit ca798177b9
16 changed files with 191 additions and 46 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ import { NextRequest, NextResponse } from 'next/server';
import { getAuthInfoFromCookie } from '@/lib/auth';
import { getConfig, setCachedConfig } from '@/lib/config';
import { db } from '@/lib/db';
import { normalizeApiBaseUrl } from '@/lib/url';
export const runtime = 'nodejs';
@@ -63,7 +64,7 @@ export async function POST(request: NextRequest) {
// 更新缓存中的音乐配置
adminConfig.MusicConfig = {
Enabled,
BaseUrl,
BaseUrl: normalizeApiBaseUrl(BaseUrl),
Token,
ProxyEnabled: ProxyEnabled ?? true,
};