فهرست منبع

Merge branch 'master' of https://git.cocorobo.cn/CocoRoboLabs/pbl_admin_table

SanHQin 1 ماه پیش
والد
کامیت
6467e54589
2فایلهای تغییر یافته به همراه14 افزوده شده و 1 حذف شده
  1. 1 1
      src/components/topPage.vue
  2. 13 0
      src/main.js

+ 1 - 1
src/components/topPage.vue

@@ -324,7 +324,7 @@ import { API_CONFIG } from "@/common/apiConfig";
                 let url = ''
                 val.url.forEach(e => {
                      // if (e.region == this.userinfo.schoolArea || e.region == this.userinfo.orgArea) {
-                    if (e.region == "beta") {
+                    if (e.region == this.$region) {
                         url = e.url
                     }
                 });

+ 13 - 0
src/main.js

@@ -16,6 +16,19 @@ Vue.use(ElementUI);
 
 // 将 axios 挂载到 Vue 实例上
 Vue.prototype.$ajax = axios;
+let region = 'cn'
+// BaseUrl='http://gpt4.cocorobo.cn:8011/';
+if (parent?.location?.href.includes('beta')) {
+  region = 'beta'
+} else if (parent?.location?.href.includes('cn')) {
+  region = 'cn'
+} else if (parent?.location?.href.includes('hk')) {
+  region = 'hk'
+} else if (parent?.location?.href.includes('com')) {
+  region = 'com'
+} 
+
+Vue.prototype.$region = region;
 
 new Vue({
   router,