zhonghuizhen 9 bulan lalu
induk
melakukan
7749546bdc
1 mengubah file dengan 5 tambahan dan 1 penghapusan
  1. 5 1
      public/config.js

+ 5 - 1
public/config.js

@@ -1,5 +1,9 @@
 (function (global) {
-    const BASE_URL = "http://192.168.2.209/";
+     // 是否启用动态API,启用后,将根据访问IP的origin获取API地址
+    const ENABLE_DYNAMIC_API = false
+    const HOST_URL = `${location.origin}${location.pathname}`
+    const BASE_URL = ENABLE_DYNAMIC_API ? HOST_URL : 'http://192.168.2.209/'
+    //const BASE_URL = "http://192.168.2.209/";
     global.__IBPS_CONFIG__ = {
         // 是否启用配置
         ENABLE_CONFIG: true,