feat: expose storyforge through public cloud gateway

This commit is contained in:
kris
2026-03-23 17:52:09 +08:00
parent aeccea585e
commit 841985c0d2
7 changed files with 238 additions and 1 deletions

View File

@@ -14,6 +14,7 @@
- 目录已经从 `output/ui/` 原型区独立出来,并接上了第一层真实业务接口
- 这里面向国内平台的 Web 承载,当前覆盖 `douyin``xiaohongshu``bilibili``kuaishou``wechat_video`
- `YouTube` 目前明确不在本轮范围内
- 已支持通过 `https://test.hyzq.net/storyforge/` 做公网访问
- 通用的项目、内容源、复盘、集成等流程可以正常使用
- 平台工作台和运行时数据目前只有 `douyin` 做到了完整实现,其余平台统一按 `待接入工作台` 处理
- 当前保留的核心页面结构:
@@ -99,6 +100,14 @@ python3 -m http.server 3918
- `http://127.0.0.1:8081`
如果页面部署在:
- `https://test.hyzq.net/storyforge/`
前端会自动把默认后端切到同源的:
- `https://test.hyzq.net/storyforge`
## 后续建议
- 继续补多平台各自更深的专属采集与解析能力,而不只是一套统一抽象层

View File

@@ -1,5 +1,20 @@
const STORAGE_KEY = "storyforge-web-v4-session";
const DEFAULT_BACKEND_URL = "http://127.0.0.1:8081";
function detectDefaultBackendUrl() {
if (typeof window === "undefined") {
return "http://127.0.0.1:8081";
}
const { origin, hostname, port, pathname } = window.location;
if (/^https?:/i.test(origin) && pathname.startsWith("/storyforge")) {
return `${origin}/storyforge`;
}
if ((hostname === "127.0.0.1" || hostname === "localhost") && port && port !== "8081") {
return "http://127.0.0.1:8081";
}
return "http://127.0.0.1:8081";
}
const DEFAULT_BACKEND_URL = detectDefaultBackendUrl();
const navButtons = document.querySelectorAll("[data-screen-target]");
const screens = Array.from(document.querySelectorAll("[data-screen]"));