From e9bd1ee4e0ebb3b39dd4988a22619af4e93f3344 Mon Sep 17 00:00:00 2001
From: TiaStars <L18864257234@163.com>
Date: Fri, 21 Jun 2024 09:59:48 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E7=95=99=E7=99=BB=E5=BD=95=E9=A1=B5?=
 =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E4=B8=BA=E5=8A=A8=E6=80=81=E8=8E=B7?=
 =?UTF-8?q?=E5=8F=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .env.development                              |  4 +--
 package.json                                  |  2 +-
 src/components/Editor/index.vue               |  4 +--
 src/components/FileUpload/index.vue           |  4 +--
 src/components/ImagePreview/index.vue         |  4 +--
 src/components/ImageUpload/index.vue          |  4 +--
 src/layout/components/FixedHeader/index.vue   |  2 +-
 src/permission.js                             | 24 +++++++--------
 src/plugins/download.js                       |  2 +-
 src/store/modules/user.js                     |  6 ++--
 src/utils/request.js                          |  2 +-
 .../enterInfo/components/tabOne/index.vue     |  2 +-
 src/views/enterpriselibrary/index.vue         |  4 +--
 src/views/login.vue                           | 29 +++++++++++++++----
 src/views/monitor/druid/index.vue             |  2 +-
 .../declareDetailContent/index.vue            |  2 +-
 .../records/components/index.vue              |  2 +-
 src/views/project/index.vue                   |  4 +--
 .../projectInfo/components/tabOne/index.vue   |  2 +-
 src/views/system/user/index.vue               |  2 +-
 src/views/system/user/profile/userAvatar.vue  |  2 +-
 src/views/tool/swagger/index.vue              |  2 +-
 vue.config.js                                 |  2 +-
 23 files changed, 66 insertions(+), 47 deletions(-)

diff --git a/.env.development b/.env.development
index a60aba1..82f07d9 100644
--- a/.env.development
+++ b/.env.development
@@ -5,8 +5,8 @@ VUE_APP_TITLE = 金鸡湖现代服务业品牌管理系统
 ENV = 'development'
 
 # 金鸡湖现代服务业品牌管理系统/开发环境
-VUE_APP_BASE_API = 'http://192.168.0.105:9040'
-# VUE_APP_BASE_API = 'http://39.101.188.84:9040'
+# VUE_APP_BASE_API = 'http://192.168.0.105:9040'
+VUE_APP_BASE_API = 'http://39.101.188.84:9040'
 # VUE_APP_BASE_API = 'https://idp.sipac.gov.cn/api'
 
 # 路由懒加载
diff --git a/package.json b/package.json
index 4077499..2288109 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "ruoyi",
-  "version": "1.0.202406201411",
+  "version": "1.0.202406210919",
   "description": "金鸡湖现代服务业品牌管理系统",
   "author": "若依",
   "license": "MIT",
diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue
index 7ea4322..3337591 100644
--- a/src/components/Editor/index.vue
+++ b/src/components/Editor/index.vue
@@ -60,7 +60,7 @@ export default {
   },
   data() {
     return {
-      uploadUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
+      uploadUrl: location.origin + '/api'  + "/common/upload", // 上传的图片服务器地址
       headers: {
         Authorization: "Bearer " + getToken()
       },
@@ -194,7 +194,7 @@ export default {
         // 获取光标所在位置
         let length = quill.getSelection().index;
         // 插入图片  res.url为服务器返回的图片地址
-        quill.insertEmbed(length, "image", process.env.VUE_APP_BASE_API + res.fileName);
+        quill.insertEmbed(length, "image", location.origin + '/api'  + res.fileName);
         // 调整光标到最后
         quill.setSelection(length + 1);
       } else {
diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue
index c7f6b0a..f2c9e52 100644
--- a/src/components/FileUpload/index.vue
+++ b/src/components/FileUpload/index.vue
@@ -72,8 +72,8 @@ export default {
     return {
       number: 0,
       uploadList: [],
-      baseUrl: process.env.VUE_APP_BASE_API,
-      uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传文件服务器地址
+      baseUrl: location.origin + '/api' ,
+      uploadFileUrl: location.origin + '/api'  + "/common/upload", // 上传文件服务器地址
       headers: {
         Authorization: "Bearer " + getToken(),
       },
diff --git a/src/components/ImagePreview/index.vue b/src/components/ImagePreview/index.vue
index 3c770c7..fd59e3b 100644
--- a/src/components/ImagePreview/index.vue
+++ b/src/components/ImagePreview/index.vue
@@ -39,7 +39,7 @@ export default {
       if (isExternal(real_src)) {
         return real_src;
       }
-      return process.env.VUE_APP_BASE_API + real_src;
+      return location.origin + '/api'  + real_src;
     },
     realSrcList() {
       if (!this.src) {
@@ -51,7 +51,7 @@ export default {
         if (isExternal(item)) {
           return srcList.push(item);
         }
-        return srcList.push(process.env.VUE_APP_BASE_API + item);
+        return srcList.push(location.origin + '/api'  + item);
       });
       return srcList;
     },
diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue
index 2e64c9b..11c1622 100644
--- a/src/components/ImageUpload/index.vue
+++ b/src/components/ImageUpload/index.vue
@@ -76,8 +76,8 @@ export default {
       dialogImageUrl: "",
       dialogVisible: false,
       hideUpload: false,
-      baseUrl: process.env.VUE_APP_BASE_API,
-      uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
+      baseUrl: location.origin + '/api' ,
+      uploadImgUrl: location.origin + '/api'  + "/common/upload", // 上传的图片服务器地址
       headers: {
         Authorization: "Bearer " + getToken(),
       },
diff --git a/src/layout/components/FixedHeader/index.vue b/src/layout/components/FixedHeader/index.vue
index 055bed5..68193a9 100644
--- a/src/layout/components/FixedHeader/index.vue
+++ b/src/layout/components/FixedHeader/index.vue
@@ -90,7 +90,7 @@ export default {
             // location.href = "/index";
             // console.log("this.$store.state.user.userType",this.$store.state.user.userType);
             // if(this.$store.state.user.userType == "01") {
-            //   location.href = process.env.VUE_APP_BASE_API + "/system/singlelogin/login"
+            //   location.href = location.origin + '/api'  + "/system/singlelogin/login"
             // } else {
             //   this.$router.replace("/login");
             // }
diff --git a/src/permission.js b/src/permission.js
index 6c8cadd..b0b7139 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -53,7 +53,7 @@ router.beforeEach((to, from, next) => {
       }).catch((err) => {
         store.dispatch("LogOut").then(() => {
           Message.error(err);
-          location.href = process.env.VUE_APP_BASE_API + "/system/singlelogin/login"
+          location.href = location.origin + '/api'  + "/system/singlelogin/login"
         });
       });
     } else {
@@ -149,17 +149,17 @@ router.beforeEach((to, from, next) => {
     }
   } else {
     // 没有token
-    // if (whiteList.indexOf(to.path) !== -1) {
-    //   // 在免登录白名单,直接进入
-    //   next();
-    // } else {
-    //   next(`/login?redirect=${encodeURIComponent(to.fullPath)}`); // 否则全部重定向到登录页
-    //   NProgress.done();
-    // }
-    store.dispatch("LogOut").then(() => {
-      Message.error(err);
-      location.href = process.env.VUE_APP_BASE_API + "/system/singlelogin/login"
-    });
+    if (whiteList.indexOf(to.path) !== -1) {
+      // 在免登录白名单,直接进入
+      next();
+    } else {
+      next(`/login?redirect=${encodeURIComponent(to.fullPath)}`); // 否则全部重定向到登录页
+      NProgress.done();
+    }
+    // store.dispatch("LogOut").then(() => {
+    //   Message.error(err);
+    //   location.href = location.origin + '/api'  + "/system/singlelogin/login"
+    // });
   }
 });
 
diff --git a/src/plugins/download.js b/src/plugins/download.js
index 42acd00..ab27122 100644
--- a/src/plugins/download.js
+++ b/src/plugins/download.js
@@ -5,7 +5,7 @@ import { getToken } from '@/utils/auth'
 import errorCode from '@/utils/errorCode'
 import { blobValidate } from "@/utils/ruoyi";
 
-const baseURL = process.env.VUE_APP_BASE_API
+const baseURL = location.origin + '/api' 
 let downloadLoadingInstance;
 
 export default {
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 600aa89..4f94f0a 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -134,7 +134,7 @@ const user = {
         getInfo().then(res => {
           // console.log(res);
           const user = res.user
-          const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
+          const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : location.origin + '/api'  + user.avatar;
           if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
             commit('SET_ROLES', res.roles)
             commit('SET_PERMISSIONS', res.permissions)
@@ -180,7 +180,7 @@ const user = {
               commit('SET_ROLES', [])
               commit('SET_PERMISSIONS', [])
               removeToken()
-              resolve()
+              resolve({userType:state.userType})
             })
           }).catch(error => {
             reject(error)
@@ -193,7 +193,7 @@ const user = {
             commit('SET_ROLES', [])
             commit('SET_PERMISSIONS', [])
             removeToken()
-            resolve()
+            resolve({userType:state.userType})
           }).catch(error => {
             reject(error)
           })
diff --git a/src/utils/request.js b/src/utils/request.js
index d273357..6471c8d 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -16,7 +16,7 @@ axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
 // 创建axios实例
 const service = axios.create({
   // axios中请求配置有baseURL选项,表示请求URL公共部分
-  baseURL: process.env.VUE_APP_BASE_API,
+  baseURL: location.origin + '/api' ,
   // 超时
   timeout: 10000
 })
diff --git a/src/views/enterpriselibrary/enterInfo/components/tabOne/index.vue b/src/views/enterpriselibrary/enterInfo/components/tabOne/index.vue
index 2f6b864..4fd0cfc 100644
--- a/src/views/enterpriselibrary/enterInfo/components/tabOne/index.vue
+++ b/src/views/enterpriselibrary/enterInfo/components/tabOne/index.vue
@@ -96,7 +96,7 @@ export default {
       info:[],
       fileInfo:[],
       loading:false,
-      VUE_APP_BASE_API:process.env.VUE_APP_BASE_API,
+      VUE_APP_BASE_API:location.origin + '/api' ,
     }
   },
   mounted() {
diff --git a/src/views/enterpriselibrary/index.vue b/src/views/enterpriselibrary/index.vue
index b2a5d96..9cc8895 100644
--- a/src/views/enterpriselibrary/index.vue
+++ b/src/views/enterpriselibrary/index.vue
@@ -174,7 +174,7 @@ export default {
       },
       title:"导入企业",
       infoVisible:false,
-      baseUrl: process.env.VUE_APP_BASE_API,
+      baseUrl: location.origin + '/api' ,
       // 用户导入参数
       upload: {
         // 是否禁用上传
@@ -184,7 +184,7 @@ export default {
         // 设置上传的请求头部
         headers: { Authorization: "Bearer " + getToken() },
         // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/system/enterpriseBasicInfo/importEnterprise"
+        url: location.origin + '/api'  + "/system/enterpriseBasicInfo/importEnterprise"
       },
       fileList: [],
       number: 0,
diff --git a/src/views/login.vue b/src/views/login.vue
index 7ec7c0b..f296483 100644
--- a/src/views/login.vue
+++ b/src/views/login.vue
@@ -7,7 +7,7 @@
       class="login-form"
     >
       <!-- <h3 class="title">若依后台管理系统</h3> -->
-      <el-tabs v-model="userType">
+      <el-tabs v-model="userType" @tab-click="handleClick">
         <el-tab-pane label="企业用户登录" name="01"></el-tab-pane>
         <el-tab-pane label="政务用户登录" name="02"></el-tab-pane>
       </el-tabs>
@@ -75,6 +75,15 @@
           <span v-if="!loading">登 录</span>
           <span v-else>登 录 中...</span>
         </el-button>
+        <el-button
+          size="medium"
+          type="primary"
+          style="width: 100%;margin-left: 0;margin-top: 20px;"
+          @click.native.prevent="changeHttp"
+        >
+          <span>政务通统一身份认证登录</span>
+          <!-- <span v-else>登 录 中...</span> -->
+        </el-button>
         <div style="float: right" v-if="register">
           <router-link class="link-type" :to="'/register'"
             >立即注册</router-link
@@ -147,10 +156,15 @@ export default {
     },
   },
   created() {
-    this.getCode();
+    // this.getCode();
     this.getCookie();
   },
   methods: {
+    handleClick(tab){
+     if(tab.index == "1") {
+      this.getCode();
+     }
+    },
     getCode() {
       getCodeImg().then((res) => {
         this.captchaEnabled =
@@ -174,7 +188,7 @@ export default {
     },
     handleLogin() {
       if(this.userType == '01') {
-        location.href = process.env.VUE_APP_BASE_API + "/system/singlelogin/login"
+        location.href = location.origin + '/api'  + "/system/singlelogin/login"
       } else {
         this.$refs.loginForm.validate((valid) => {
           if (valid) {
@@ -200,13 +214,18 @@ export default {
               .catch(() => {
                 this.loading = false;
                 if (this.captchaEnabled) {
-                  this.getCode();
+                  if(this.userType == "02") {
+                    this.getCode();
+                  }
                 }
               });
           }
         });
       }
     },
+    changeHttp(){
+      location.href = "https://qyt.sipac.gov.cn/sipsg-enterprise-mobile-manage/#/login"
+    },
   },
 };
 </script>
@@ -240,7 +259,7 @@ export default {
   border-radius: 6px;
   background: #ffffff;
   width: 400px;
-  height: 380px;
+  height: 420px;
   padding: 25px 25px 5px 25px;
   box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.15);
   .el-input {
diff --git a/src/views/monitor/druid/index.vue b/src/views/monitor/druid/index.vue
index c6ad585..a5b8d84 100644
--- a/src/views/monitor/druid/index.vue
+++ b/src/views/monitor/druid/index.vue
@@ -8,7 +8,7 @@ export default {
   components: { iFrame },
   data() {
     return {
-      url: process.env.VUE_APP_BASE_API + "/druid/login.html"
+      url: location.origin + '/api'  + "/druid/login.html"
     };
   },
 };
diff --git a/src/views/onlineDeclaration/declareDetailContent/index.vue b/src/views/onlineDeclaration/declareDetailContent/index.vue
index c4e5153..ee583e7 100644
--- a/src/views/onlineDeclaration/declareDetailContent/index.vue
+++ b/src/views/onlineDeclaration/declareDetailContent/index.vue
@@ -1945,7 +1945,7 @@ export default {
   dicts: ['bms_responsibility_unit', 'bms_level', 'bms_affiliation_type', 'sys_declaration_type', 'jjh_project_type', 'template_industry', 'new_template_type'],
   data() {
     return {
-      VUE_APP_BASE_API:process.env.VUE_APP_BASE_API,
+      VUE_APP_BASE_API:location.origin + '/api' ,
       size: '',
       templateInfo: {},
       baseInfo: {},
diff --git a/src/views/onlineDeclaration/records/components/index.vue b/src/views/onlineDeclaration/records/components/index.vue
index 845e121..1f8643c 100644
--- a/src/views/onlineDeclaration/records/components/index.vue
+++ b/src/views/onlineDeclaration/records/components/index.vue
@@ -714,7 +714,7 @@ export default {
   name:"updataChange",
   data() {
     return {
-      VUE_APP_BASE_API:process.env.VUE_APP_BASE_API,
+      VUE_APP_BASE_API:location.origin + '/api' ,
       openCity: false,
       enterpriseInfo: {},
       form:{
diff --git a/src/views/project/index.vue b/src/views/project/index.vue
index e02487b..bb12369 100644
--- a/src/views/project/index.vue
+++ b/src/views/project/index.vue
@@ -282,8 +282,8 @@ export default {
         // 设置上传的请求头部
         headers: { Authorization: "Bearer " + getToken() },
         // 上传的地址
-        // url: process.env.VUE_APP_BASE_API + "/jjh/jProject/export"
-        url: process.env.VUE_APP_BASE_API + "/jjh/jProject/importTemplateProject"
+        // url: location.origin + '/api'  + "/jjh/jProject/export"
+        url: location.origin + '/api'  + "/jjh/jProject/importTemplateProject"
       },
       tabHeader: undefined,
     };
diff --git a/src/views/project/projectInfo/components/tabOne/index.vue b/src/views/project/projectInfo/components/tabOne/index.vue
index ef5100c..807449e 100644
--- a/src/views/project/projectInfo/components/tabOne/index.vue
+++ b/src/views/project/projectInfo/components/tabOne/index.vue
@@ -161,7 +161,7 @@ export default {
       info:[],
       fileInfo:[],
       loading:false,
-      VUE_APP_BASE_API:process.env.VUE_APP_BASE_API,
+      VUE_APP_BASE_API:location.origin + '/api' ,
     }
   },
   mounted() {
diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index fc75041..d3a3db1 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -431,7 +431,7 @@ export default {
         // 设置上传的请求头部
         headers: { Authorization: "Bearer " + getToken() },
         // 上传的地址
-        url: process.env.VUE_APP_BASE_API + "/system/user/importData"
+        url: location.origin + '/api'  + "/system/user/importData"
       },
       // 查询参数
       queryParams: {
diff --git a/src/views/system/user/profile/userAvatar.vue b/src/views/system/user/profile/userAvatar.vue
index c4fdeeb..a2b53af 100644
--- a/src/views/system/user/profile/userAvatar.vue
+++ b/src/views/system/user/profile/userAvatar.vue
@@ -137,7 +137,7 @@ export default {
         formData.append("avatarfile", data, this.options.filename);
         uploadAvatar(formData).then(response => {
           this.open = false;
-          this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
+          this.options.img = location.origin + '/api'  + response.imgUrl;
           store.commit('SET_AVATAR', this.options.img);
           this.$modal.msgSuccess("修改成功");
           this.visible = false;
diff --git a/src/views/tool/swagger/index.vue b/src/views/tool/swagger/index.vue
index b8becc6..05d8608 100644
--- a/src/views/tool/swagger/index.vue
+++ b/src/views/tool/swagger/index.vue
@@ -8,7 +8,7 @@ export default {
   components: { iFrame },
   data() {
     return {
-      url: process.env.VUE_APP_BASE_API + "/swagger-ui/index.html"
+      url: location.origin + '/api'  + "/swagger-ui/index.html"
     };
   },
 };
diff --git a/vue.config.js b/vue.config.js
index 405310d..a7a80de 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -19,7 +19,7 @@ module.exports = {
   // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
   // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
   // demo/JinJiHu
-  publicPath: process.env.NODE_ENV === "production" ? "./" : "/",
+  publicPath: process.env.NODE_ENV === "production" ? "/demo/JinJiHu" : "/",
   // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
   outputDir: "dist",
   // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)