feat: 添加音乐API代理以解决CORS跨域问题

- index.html: 将API_BASE改为相对路径 /api/music-api
- sync-server/server.js: 新增 /music-api 代理端点转发请求至 music-dl.sayqz.com
- 新增 proxyRequest 函数处理HTTPS代理请求和重定向
This commit is contained in:
史悦
2026-01-14 15:17:58 +08:00
parent c9fac4b7fe
commit a76ef33c4c
2 changed files with 82 additions and 24 deletions

View File

@@ -138,7 +138,7 @@
<script type="text/babel">
const { useState, useEffect, useRef, useMemo, useCallback } = React;
const API_BASE = "https://music-dl.sayqz.com";
const API_BASE = "/api/music-api";
// Use relative path for sync service, assuming Nginx proxy is configured to forward /api/kv to the sync service
const SYNC_API_BASE = "/api";