jinv2 commited on
Commit
4a7f6be
·
verified ·
1 Parent(s): e0b7903

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. netlify.toml +2 -0
  2. ui_frontend/script.js +4 -2
netlify.toml ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [build]
2
+ publish = "ui_frontend"
ui_frontend/script.js CHANGED
@@ -1,7 +1,9 @@
1
  let currentMode = 'normal'; // 🎬 默认为普通模式
2
 
3
- // ⚡ 核心修正:统一 API 地址到本地 7860 端口 (Hugging Face 默认)
4
- const API_URL = "http://127.0.0.1:7860/theater";
 
 
5
 
6
  function setMode(mode) {
7
  currentMode = mode;
 
1
  let currentMode = 'normal'; // 🎬 默认为普通模式
2
 
3
+ // ⚡ 核心修正:自动适配本地与生产 (Hugging Face) 环境
4
+ const API_URL = window.location.hostname === "127.0.0.1" || window.location.hostname === "localhost"
5
+ ? "http://127.0.0.1:7860/theater"
6
+ : "https://jinv2-shensist-theater-matrix.hf.space/theater";
7
 
8
  function setMode(mode) {
9
  currentMode = mode;