first commit

This commit is contained in:
flowerstonezl
2026-05-11 19:34:35 +08:00
commit c90b10cd5a
89 changed files with 6142 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
/**
* 网易云外链播放器:在前端配置,不经过 Django。
*
* 在 `frontend/.env` / `.env.development` 中设置:
* VITE_NETEASE_PLAYER_SRC=https://music.163.com/outchain/player?type=2&id=…&auto=1&height=66
* 也可粘贴整段 `<iframe … src="…">`,会自动取出 src。
*/
function extractIframeSrc(raw: string): string {
const t = raw.trim()
if (!t) return ''
const m = /\bsrc\s*=\s*["']([^"']+)["']/i.exec(t)
return (m ? m[1] : t).trim()
}
const fromEnv = (import.meta.env.VITE_NETEASE_PLAYER_SRC as string | undefined)?.trim() ?? ''
export const NETEASE_PLAYER_SRC = extractIframeSrc(fromEnv)