问题:容器内 SystemSettings.kugouApiBaseUrl 默认 http://127.0.0.1:3000 指向自己,sidecar 不可达。 修复:1) schema + migration 移除 kugouApiBaseUrl 默认值;kugouService + status API 兜底改空串(不再假设有 localhost),优先级 env(KUGOU_API_BASE) > DB。 2) 新增 POST /api/admin/kugou/settings:ADMIN+/SUPER 即时写 kugouApiBaseUrl 入库+刷新 CacheService。 3) KuGouImporter.client.vue 左栏新增 baseUrl 输入框(回车即存)+ 保存并测试按钮 + 两个推荐快捷按钮(容器宿主 http://172.19.0.1:3000、公网中继 https://bywmusic.bzw-hheb.top/kugou)+ 当前生效地址显式提示。 4) UI/Icon.vue 新增 server / globe / save 三个 SVG 图标与上述入口配套。
29 lines
1.0 KiB
SQL
29 lines
1.0 KiB
SQL
-- 酷狗导入:管理员账号凭证 + 按日歌单同步记录表
|
|
ALTER TABLE "SystemSettings"
|
|
ADD COLUMN IF NOT EXISTS "kugouApiBaseUrl" text,
|
|
ADD COLUMN IF NOT EXISTS "kugouAdminCookie" text,
|
|
ADD COLUMN IF NOT EXISTS "kugouAdminToken" text,
|
|
ADD COLUMN IF NOT EXISTS "kugouAdminUser" jsonb,
|
|
ADD COLUMN IF NOT EXISTS "kugouAdminBoundAt" timestamp;
|
|
|
|
CREATE TABLE IF NOT EXISTS "KuGouPlaylistSync" (
|
|
"id" serial PRIMARY KEY,
|
|
"createdAt" timestamp DEFAULT now() NOT NULL,
|
|
"updatedAt" timestamp DEFAULT now() NOT NULL,
|
|
"playDate" date NOT NULL,
|
|
"semesterId" integer,
|
|
"playlistId" text,
|
|
"playlistName" text NOT NULL,
|
|
"playlistUrl" text,
|
|
"totalSongs" integer DEFAULT 0 NOT NULL,
|
|
"addedSongs" integer DEFAULT 0 NOT NULL,
|
|
"missingSongs" jsonb DEFAULT '[]'::jsonb NOT NULL,
|
|
"status" text DEFAULT 'pending' NOT NULL,
|
|
"error" text,
|
|
"triggeredByUserId" integer,
|
|
"rawResponse" jsonb DEFAULT '{}'::jsonb NOT NULL
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS "KuGouPlaylistSync_playDate_idx"
|
|
ON "KuGouPlaylistSync" ("playDate" DESC);
|