main.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import Vue from 'vue'; // 引入 Vue 2
  2. import App from './App.vue'; // 引入根组件
  3. import router from './router'; // 引入路由
  4. import store from './store'; // 引入 Vuex store
  5. import ElementUI from 'element-ui'; // 引入 Element UI
  6. import 'element-ui/lib/theme-chalk/index.css'; // 引入 Element UI 样式
  7. import axios from './common/axios.config'; // 引入 axios 配置实例
  8. import '@/permission' // permission control
  9. Vue.config.productionTip = false; // 关闭生产模式提示
  10. // 使用 Element UI 插件
  11. Vue.use(ElementUI);
  12. // 将 axios 挂载到 Vue 实例上
  13. Vue.prototype.$ajax = axios;
  14. let region = 'cn'
  15. // BaseUrl='http://gpt4.cocorobo.cn:8011/';
  16. if (parent?.location?.href.includes('beta')) {
  17. console.log(parent.location.href);
  18. region = 'beta'
  19. } else if (parent?.location?.href.includes('cn')) {
  20. console.log(parent.location.href);
  21. region = 'cn'
  22. } else if (parent?.location?.href.includes('hk')) {
  23. console.log(parent.location.href);
  24. region = 'hk'
  25. } else if (parent?.location?.href.includes('com')) {
  26. console.log(parent.location.href);
  27. region = 'com'
  28. }
  29. Vue.prototype.$region = region;
  30. new Vue({
  31. router,
  32. store,
  33. render: h => h(App),
  34. }).$mount('#app');