luohailiang 2 年之前
父節點
當前提交
c1f3f41f18
共有 3 個文件被更改,包括 78 次插入58 次删除
  1. 33 29
      public/config.js
  2. 33 25
      public/jsc/config.js
  3. 12 4
      public/manage/config.js

+ 33 - 29
public/config.js

@@ -1,42 +1,46 @@
-// tips
-// 所有url需要以/结尾
-
 // 本地开发环境
 const local = {
-  web_pc: 'https://tyyx.bozedu.top/',
-  web_mobile: 'https://tyyxm.bozedu.top/',
-
-  api: 'https://tyyxopenapi.bozedu.top/',
-  oss: 'https://tyyxopenapi.bozedu.top/',
-  origin: window.location.origin,
+    web_pc: 'https://tyyx.bozedu.top/',
+    web_mobile: 'https://tyyxm.bozedu.top/',
+    api: 'https://tyyxopenapi.bozedu.top/',
+    oss: 'https://tyyxopenapi.bozedu.top/',
+    origin: window.location.origin,
 }
 
 // 测试服环境
 const development = {
-  web_pc: 'https://tyyx.bozedu.top/',
-  web_mobile: 'https://tyyxm.bozedu.top/',
-  origin: window.location.origin,
-  api: 'https://tyyxopenapi.bozedu.top/',
-  oss: 'https://tyyxopenapi.bozedu.top/'
+    web_pc: 'https://tyyx.bozedu.top/',
+    web_mobile: 'https://tyyxm.bozedu.top/',
+    origin: window.location.origin,
+    api: 'https://tyyxopenapi.bozedu.top/',
+    oss: 'https://tyyxopenapi.bozedu.top/'
+}
+// 演示服环境
+const demo = {
+    web_pc: 'https://tyyx.bozedu.net/',
+    web_mobile: 'https://tyyxm.bozedu.net/',
+    origin: window.location.origin,
+    api: 'https://tyyxopenapi.bozedu.net/',
+    oss: 'https://tyyxopenapi.bozedu.net/'
 }
-
 // 正式服环境
 const production = {
-  web_pc: 'https://tyyx.bozedu.net/',
-  web_mobile: 'https://tyyxm.bozedu.net/',
-  origin: window.location.origin,
-  api: 'https://tyyxopenapi.bozedu.net/',
-  oss: 'https://tyyxopenapi.bozedu.net/'
+    web_pc: 'https://tyyx.txhlwxx.com/',
+    web_mobile: 'https://tyyxm.txhlwxx.com/',
+    origin: window.location.origin,
+    api: 'https://tyyxopenapi.txhlwxx.com/',
+    oss: 'https://tyyxopenapi.txhlwxx.com/'
 }
 
 function isWhich() {
-  if (window.location.host.includes('tyyx.bozedu.top')) {
-    return development
-  } else if(window.location.host.includes('tyyx.bozedu.net')) {
-      return production
-  } else {
-    return local
-  }
+    if (window.location.host.includes('tyyx.bozedu.top')) {
+        return development
+    } else if(window.location.host.includes('tyyx.bozedu.net')) {
+        return demo
+    } else if(window.location.host.includes('tyyx.txhlwxx.com')) {
+        return production
+    } else {
+        return local
+    }
 }
-window.GLOBAL_CONFIG = isWhich()
-
+window.GLOBAL_CONFIG = isWhich()

+ 33 - 25
public/jsc/config.js

@@ -1,38 +1,46 @@
 // 本地开发环境
 const local = {
-  web_pc: 'https://tyyx.bozedu.top/',
-  web_mobile: 'https://tyyxm.bozedu.top/',
-
-  api: 'https://tyyxopenapi.bozedu.top/',
-  oss: 'https://tyyxopenapi.bozedu.top/',
-  origin: window.location.origin,
+    web_pc: 'https://tyyx.bozedu.top/',
+    web_mobile: 'https://tyyxm.bozedu.top/',
+    api: 'https://tyyxopenapi.bozedu.top/',
+    oss: 'https://tyyxopenapi.bozedu.top/',
+    origin: window.location.origin,
 }
 
 // 测试服环境
 const development = {
-  web_pc: 'https://tyyx.bozedu.top/',
-  web_mobile: 'https://tyyxm.bozedu.top/',
-  origin: window.location.origin,
-  api: 'https://tyyxopenapi.bozedu.top/',
-  oss: 'https://tyyxopenapi.bozedu.top/'
+    web_pc: 'https://tyyx.bozedu.top/',
+    web_mobile: 'https://tyyxm.bozedu.top/',
+    origin: window.location.origin,
+    api: 'https://tyyxopenapi.bozedu.top/',
+    oss: 'https://tyyxopenapi.bozedu.top/'
+}
+// 演示服环境
+const demo = {
+    web_pc: 'https://tyyx.bozedu.net/',
+    web_mobile: 'https://tyyxm.bozedu.net/',
+    origin: window.location.origin,
+    api: 'https://tyyxopenapi.bozedu.net/',
+    oss: 'https://tyyxopenapi.bozedu.net/'
 }
-
 // 正式服环境
 const production = {
-  web_pc: 'https://tyyx.bozedu.net/',
-  web_mobile: 'https://tyyxm.bozedu.net/',
-  origin: window.location.origin,
-  api: 'https://tyyxopenapi.bozedu.net/',
-  oss: 'https://tyyxopenapi.bozedu.net/'
+    web_pc: 'https://tyyx.txhlwxx.com/',
+    web_mobile: 'https://tyyxm.txhlwxx.com/',
+    origin: window.location.origin,
+    api: 'https://tyyxopenapi.txhlwxx.com/',
+    oss: 'https://tyyxopenapi.txhlwxx.com/'
 }
 
 function isWhich() {
-  if (window.location.href.startsWith(development.web)) {
-    return development
-  } else if (window.location.href.startsWith(production.web)) {
-    return production
-  } else {
-    return local
-  }
+    if (window.location.host.includes('tyyx.bozedu.top')) {
+        return development
+    } else if(window.location.host.includes('tyyx.bozedu.net')) {
+        return demo
+    } else if(window.location.host.includes('tyyx.txhlwxx.com')) {
+        return production
+    } else {
+        return local
+    }
 }
-window.GLOBAL_CONFIG = isWhich()
+window.GLOBAL_CONFIG = isWhich()

+ 12 - 4
public/manage/config.js

@@ -2,7 +2,6 @@
 const local = {
     web_pc: 'https://tyyx.bozedu.top/',
     web_mobile: 'https://tyyxm.bozedu.top/',
-
     api: 'https://tyyxopenapi.bozedu.top/',
     oss: 'https://tyyxopenapi.bozedu.top/',
     origin: window.location.origin,
@@ -16,20 +15,29 @@ const development = {
     api: 'https://tyyxopenapi.bozedu.top/',
     oss: 'https://tyyxopenapi.bozedu.top/'
 }
-
-// 正式服环境
-const production = {
+// 演示服环境
+const demo = {
     web_pc: 'https://tyyx.bozedu.net/',
     web_mobile: 'https://tyyxm.bozedu.net/',
     origin: window.location.origin,
     api: 'https://tyyxopenapi.bozedu.net/',
     oss: 'https://tyyxopenapi.bozedu.net/'
 }
+// 正式服环境
+const production = {
+    web_pc: 'https://tyyx.txhlwxx.com/',
+    web_mobile: 'https://tyyxm.txhlwxx.com/',
+    origin: window.location.origin,
+    api: 'https://tyyxopenapi.txhlwxx.com/',
+    oss: 'https://tyyxopenapi.txhlwxx.com/'
+}
 
 function isWhich() {
     if (window.location.host.includes('tyyx.bozedu.top')) {
         return development
     } else if(window.location.host.includes('tyyx.bozedu.net')) {
+        return demo
+    } else if(window.location.host.includes('tyyx.txhlwxx.com')) {
         return production
     } else {
         return local