豪豪 il y a 2 semaines
Parent
commit
19b9945123
7 fichiers modifiés avec 110 ajouts et 37 suppressions
  1. 1 0
      .env.development
  2. 3 2
      .env.production
  3. 11 0
      src/service/index.js
  4. 3 3
      src/service/login.js
  5. 66 27
      src/views/home-page/HomePage.vue
  6. 5 3
      src/views/login/Login.vue
  7. 21 2
      vite.config.js

+ 1 - 0
.env.development

@@ -1,2 +1,3 @@
 VITE_BASE_API='/api'
+VITE_BASE_API_V2='/api-v2'
 VITE_OPEN_URL='http://:9250'

+ 3 - 2
.env.production

@@ -1,2 +1,3 @@
-VITE_BASE_API='https://cimweb.zjw.sh.cegn.cn:2002/data-business-prod/'
-VITE_OPEN_URL='https://cimweb.zjw.sh.cegn.cn:2002/data-business-prod/'
+VITE_BASE_API='https://cimweb.zjw.sh.cegn.cn:2007/data-business-prod/'
+VITE_BASE_API_V2='https://cimweb.zjw.sh.cegn.cn:2007/data-business-prod-2/'
+VITE_OPEN_URL='https://cimweb.zjw.sh.cegn.cn:2007/data-business-prod/'

+ 11 - 0
src/service/index.js

@@ -40,6 +40,15 @@ export const requestInstance_YYFN = axios.create({
 	},
 })
 
+// 应用赋能中台
+export const requestInstanceV2 = axios.create({
+	baseURL: import.meta.env.VITE_BASE_API_V2,
+	timeout: 60000,
+	method: 'post',
+	withCredentials:true,
+})
+
+
 requestInstance_KJGL.interceptors.request.use((config) => {
 	// console.log(config)
 	return config
@@ -176,6 +185,8 @@ export const requestInstance_login = axios.create({
 	//withCredentials:true
 
 })
+/* **********  ********** */
+
 requestInstance_login.interceptors.request.use((config) => {
 	// console.log(config)
 	return config

+ 3 - 3
src/service/login.js

@@ -3,12 +3,12 @@ import {
     requestInstance_login,
     requestInstance_KJGL,
     requestInstance_KJLL,
-    requestInstance_FXFN, requestInstance_PTJK, requestInstance_CSTJ, requestInstance_YYFN
+    requestInstance_FXFN, requestInstance_PTJK, requestInstance_CSTJ, requestInstance_YYFN, requestInstanceV2
 } from "@/service/index";
 
 export function loginCim(params) {
-    return requestInstance_login({
-        url: '/user/selectSystemByUsernameAanPasswordBySpace',
+    return requestInstanceV2({
+        url: '/login/selectSystemByUsernameAanPasswordBySpace',
         data: {
             ...params
         }

+ 66 - 27
src/views/home-page/HomePage.vue

@@ -9,7 +9,8 @@
     <div class="star">
       <div class="bg1"
            @click="toOtherRouter(item,!loginPinia.canSeeSystemArr.find(i => getModuleIdIsHas(+i.MODULE_ID,item)) && !item.children && item.aPath)"
-           v-for="item in ballSystemList" :key="item.name">
+           v-for="item in ballSystemList"
+           :key="item.name"  >
         <div class="bgc" ref="canvasGLTF">
 
         </div>
@@ -241,6 +242,8 @@ import {
 import {handleMes, showMessage} from "@/unit/element-ui/tip";
 import {encode} from "js-base64";
 
+const useSystemList = localStorage.getItem('canSeeSystemArr') !== undefined ? JSON.parse( localStorage.getItem('canSeeSystemArr')) : null
+
 // import {Clay} from "@/static/clay.min";
 onBeforeUnmount(() => {
   // cancelAnimationFrame(animationFrameId);
@@ -311,8 +314,16 @@ function loginZHFXFN(type, url, systemType) {
 }
 
 function toPage(item, isDisabled) {
-
-  let path = isDisabled ? item.loginPage : item.aPath
+  let path1 = ''
+  let ticker = ''
+  useSystemList.forEach(item1 =>{
+   if (item1.MODULE_ID === item.moduleId){
+     const ticket = encodeURIComponent(item1.TICKET);
+     path1 = item.aPath
+     ticker = '?ticket=' + ticket;
+   }
+  })
+  let path = isDisabled ? item.loginPage : path1+ticker
   if (item.isOutZj) {
     window.open(path, path)
     return;
@@ -363,7 +374,8 @@ function toPage(item, isDisabled) {
     case '663':   //城市体检
       loginZW(9, path, "47e0971bb15b4420bf1f351510378c72");
       break
-
+    default:
+      window.open(path);
   }
 }
 
@@ -443,6 +455,12 @@ function editUserLoginStateZw(usercode, userkeycode, login_lock, login_type, url
   })
 }
 
+//直接跳转登录
+function login(type,url,systemType) {
+  debugger
+  localStorage.setItem('auth-token', )
+}
+
 function loginZW(type, url, systemType) {
   debugger
   loginInZw(loginPinia.loginInfo.username, encode(loginPinia.loginInfo.psd), type)
@@ -1007,6 +1025,9 @@ const systemList = ref([
     name: '上海市城市更新信息系统'
   }
 ])
+
+
+
 const ballSystemList = ref([
   {
     name: 'GIS中台', children: [
@@ -1031,51 +1052,69 @@ const ballSystemList = ref([
       // {name:'空间地理信息共享交换系统',aPath:'https://cimweb.zjw.sh.cegn.cn:2007/space-browsing/#/main/home',moduleId:'569',loginPage:'https://cimweb.zjw.sh.cegn.cn:2007/space-browsing/#/login'},
       {
         name: 'BIM数据应用系统',
-        aPath: 'https://cimweb.zjw.sh.cegn.cn:2007/bim-application-web/',
-        moduleId: '1035',
-        loginPage: 'https://cimweb.zjw.sh.cegn.cn:2002/cim-home/#/login'
+        aPath: 'https://cimweb.zjw.sh.cegn.cn:2007/bim-application-web/#/index',
+        // aPath: 'http://localhost:5174/#/index',
+        moduleId: '1029',
+        loginPage: 'https://cimweb.zjw.sh.cegn.cn:2007/cim-home/#/login'
       },
       {
         name: 'BIM数据管理系统',
-        aPath: 'http://10.90.12.4:8008/#/login',
+        // aPath: 'http://10.90.12.4:8008/#/login',
+        aPath: 'http://10.90.12.4:8008/#/dashboard?loginCode=eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIzMDQ3IiwiaWF0IjoxNzI0NzU1MjI4LCJleHAiOjE3MjQ4NDE2Mjh9.2-BKiy8OqFQaCVmeVvDDzPzTTxXc1_ddyos6iB6zX7w&loginWay=cd-auth',
         moduleId: '964',
-        loginPage: 'https://cimweb.zjw.sh.cegn.cn:2002/cim-home/#/login'
+        loginPage: 'https://cimweb.zjw.sh.cegn.cn:2007/cim-home/#/login'
       },
     ]
   },
   {
     name: 'IOT中台', children: [
       {
-        name: '视频数据管理',
-        isOutZj: true,
-        aPath: 'http://10.86.133.76:8080/#/realMonitor?xmNo=172',
-        moduleId: '1027',
-        loginPage: 'https://cimweb.zjw.sh.cegn.cn:2002/cim-home/#/login'
+        name: '视频数据管理系统',
+        disabled: true,
+        aPath: 'http://10.90.13.56:8000',
+        moduleId: '749',
+        loginPage: 'https://cimweb.zjw.sh.cegn.cn:2007/cim-home/#/login'
+      },
+      {
+        name: '视频数据应用系统',
+        aPath: 'http://10.90.12.105:40499/#/index',
+        moduleId: '749',
+        loginPage: 'https://cimweb.zjw.sh.cegn.cn:2007/cim-home/#/login'
       },
       {
-        name: 'IOT数据管理',
-        aPath: 'http://10.90.12.105:40499/',
-        moduleId: '1028',
-        loginPage: 'https://cimweb.zjw.sh.cegn.cn:2002/cim-home/#/login'
+        name: 'IOT数据应用系统',
+        aPath: 'http://10.90.14.52:16001/dmpweb/#/index',
+        moduleId: '765',
+        loginPage: 'https://cimweb.zjw.sh.cegn.cn:2007/cim-home/#/login'
       }]
   },
   {
     name: '智能分析\nAI中台',
     children: [
+      {
+        // disabled: true,
+        name: '数据可视化系统',
+        aPath: 'http://localhost:3000/#/index',
+        moduleId: '1030',
+        loginPage: 'https://cimweb.zjw.sh.cegn.cn:2007/cim-home/#/login'
+      },
+
+      {
+        disabled: true,
+        name: '数据分析融合系统',
+        aPath: 'http://10.90.12.105:40490/#/index',
+        moduleId: '1046',
+        loginPage: 'https://cimweb.zjw.sh.cegn.cn:2007/cim-home/#/login'
+      },
+
       // {name:'数据分析赋能',aPath:'https://cimweb.zjw.sh.cegn.cn:2007/space-application/#/main/home',moduleId:'569',loginPage:'https://cimweb.zjw.sh.cegn.cn:2007/space-application/#/login'},
       {
         name: '数据治理监控',
         aPath: 'https://cimweb.zjw.sh.cegn.cn:2007/space-monitor/#/home',
         moduleId: '662',
-        loginPage: 'https://cimweb.zjw.sh.cegn.cn:2002/cim-home/#/login'
-      },
-      {
-        disabled: true,
-        name: '数据可视化系统',
-        aPath: '',
-        moduleId: '',
-        loginPage: ''
+        loginPage: 'https://cimweb.zjw.sh.cegn.cn:2007/cim-home/#/login'
       },
+
     ]
   },
   {name: '应用赋能中台', path: '/power-home', moduleId: '651',},
@@ -1419,7 +1458,7 @@ const ballSystemList = ref([
         padding: 10px;
         position: absolute;
 
-        top: 80%;
+        top: 60%;
       }
 
       //height: 290px;

+ 5 - 3
src/views/login/Login.vue

@@ -71,7 +71,8 @@ function loginMyCim(){
     }).then(res => {
       let isTrue = false
       try {
-        isTrue = res.msg[0].Rows.length > 0
+        // debugger
+        isTrue = res.data.msg[0].Rows.length > 0
 
       }catch {
         isTrue = false
@@ -88,9 +89,10 @@ function loginMyCim(){
           ...formInfo.value,
           psd:encode(formInfo.value.psd) + '21'
         }))
-        localStorage.setItem('canSeeSystemArr',JSON.stringify(res.msg[0].Rows))
+        localStorage.setItem('canSeeSystemArr',JSON.stringify(res.data.msg[0].Rows))
+        // localStorage.setItem('auth-token',JSON.stringify(res.data.msg[0].Rows[res.msg[0].Rows.length-1].token))
         loginPinia.$state.loginInfo = formInfo.value
-        loginPinia.$state.canSeeSystemArr =  res.msg[0].Rows
+        loginPinia.$state.canSeeSystemArr =  res.data.msg[0].Rows
       }
       // console.log('wodem',)
     })

+ 21 - 2
vite.config.js

@@ -10,11 +10,29 @@ export default defineConfig({
   server:{
     cors: true,
     proxy: {
+      '^/api-v2': {
+        // 代理请求之后的请求地址(你的真实接口地址)
+        // target: 'https://cimweb.zjw.sh.cegn.cn:2002/data-business-prod/',
+        target: 'https://cimweb.zjw.sh.cegn.cn:2007/data-business-prod-2/',
+        // target: 'http://localhost:9250/',
+        secure: false,
+        ws: true,
+        // 跨域
+        changeOrigin: true,
+        rewrite: (path) => path.replace(/^\/api-v2/, ''),
+        configure: (proxy) => {
+          proxy.on('proxyReq', function (proxyReq) {
+            proxyReq.removeHeader('referer')
+            proxyReq.removeHeader('origin')
+            proxyReq.setHeader('host','cimweb.zjw.sh.cegn.cn:2007')
+          })
+        },
       // 代理所有 /api 的请求,该求情将被代理到 target 中
-      '/api': {
+      '^/api': {
         // 代理请求之后的请求地址(你的真实接口地址)
         // target: 'https://cimweb.zjw.sh.cegn.cn:2002/data-business-prod/',
-        target: 'http://localhost:9250/',
+        target: 'https://cimweb.zjw.sh.cegn.cn:2007/data-business-prod/',
+        // target: 'http://localhost:9250/',
         secure: false,
         ws: true,
         // 跨域
@@ -27,6 +45,7 @@ export default defineConfig({
             proxyReq.setHeader('host','cimweb.zjw.sh.cegn.cn:2007')
           })
         },
+      },
       }
     },
   },