feat(v2.2): 剧情纯语音演绎 + 单端口 8080 托管前端
- StoryPlayer 移除文字展示区,改为纯语音逐句推进(角色+表情+跳过)
- 每句 speak 追加估时兜底(onEnd 缺失时按文本长度放行,不卡死)
- SceneTheater 开场按文本估时自动进入(兜底 15s → max(4000, len*320+2000))
- main.go SetServerRoot 托管 ui-src/dist(AddStaticPath("/") 前缀守卫只服务根路径),
/static 前缀挂载 ui-src/static 素材目录,前后端同端口 8080
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -26,5 +26,14 @@ func main() {
|
||||
|
||||
s := g.Server()
|
||||
controller.Register(s)
|
||||
// 生产形态:前端产物 ui-src/dist 由后端 :8080 统一托管(前后端同端口)
|
||||
// 注:根路径须用 SetServerRoot——AddStaticPath("/", ...) 因前缀防误匹配守卫只服务根路径,
|
||||
// /assets 等子路径全部 404;素材目录 ui-src/static 以 /static 前缀单独挂载
|
||||
if _, err := os.Stat("ui-src/dist"); err == nil {
|
||||
s.SetServerRoot("ui-src/dist")
|
||||
}
|
||||
if _, err := os.Stat("ui-src/static"); err == nil {
|
||||
s.AddStaticPath("/static", "ui-src/static")
|
||||
}
|
||||
s.Run()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user