Explorar o código

地灾兼容处理

sujunling hai 1 ano
pai
achega
8d28c35208

+ 5 - 3
public/mapview.html

@@ -34,12 +34,14 @@
             var arr = obj.split("?")
             if (arr.length && arr[1]) {
                 if (arr[1].indexOf("onlineIde_") > -1) {
-                    // creteIframe(`http://106.12.170.138:4001/examples/onlineIde.html#${arr[1].replace("onlineIde_", "")}`)
+                    creteIframe(`http://106.12.170.138:4001/examples/onlineIde.html#${arr[1].replace("onlineIde_", "")}`)
                     // creteIframe(`http://127.0.0.1:8080/examples/webgl/onlineIde.html#${arr[1].replace("onlineIde_", "")}`)
-                    creteIframe(`http://192.168.193.88:8080/examples/webgl/onlineIde.html#${arr[1].replace("onlineIde_", "")}`)
+                    // creteIframe(`http://192.168.193.88:8080/examples/webgl/onlineIde.html#${arr[1].replace("onlineIde_", "")}`)
                 } else {
                     // creteIframe(arr[1])
-                    creteIframe(`http://192.168.119.143:8080/onemapV5.0/mapview.html?${arr[1]}`)
+                    // creteIframe(`http://192.168.193.88:8080/examples/webgl/onlineIde.html#${arr[1].replace("onlineIde_", "")}`)
+                    // creteIframe(`http://192.168.119.143:8080/onemapV5.0/mapview.html?${arr[1]}`)
+                    creteIframe(`http://106.12.170.138:8080/onemapV5.0/mapview.html?${arr[1]}`)
                 }
             }
         }

+ 2 - 2
src/api/sys/dirManager.ts

@@ -28,8 +28,8 @@ export const getTreeList = (params: any) => {
  * @param: 1:用户登录tokenV2
  */
 export const getTreeRootId = (params: any) => {
-    return new Promise<void>((resolve) => {
-        defHttp.post({ ...locationType, url: Api.FindRoot, params: params }, { joinParamsToUrl: true }).then((res) => {
+    return new Promise<void>((resolve) => {//sjl,之前是, joinParamsToUrl: true
+        defHttp.post({ ...locationType, url: Api.FindRoot, params: params }, { joinParamsToUrl: false }).then((res) => {
             resolve(res)
         })
     })

+ 6 - 2
src/router/guard/permissionGuard.ts

@@ -21,9 +21,13 @@ export async function createPermissionGuard(router: Router) {
   var token = session.getItem('token')
   var tokenV2 = session.getItem('tokenV2')
   if ((location.href.indexOf('refreshToken') > -1) && (!token || !tokenV2)) {
+    var o = session.getItem('loginParams');
+
     await userStore2.login({
-      password: 'Tofly@028',
-      username: 'ADMIN2',
+      // password: 'Tofly@028',
+      // username: 'ADMIN2',
+      password: o.password,
+      username: o.username,
       mode: 'modal', //不要默认的错误提示
     }).catch((data) => {
       console.log("自动登录:", data);

+ 7 - 6
src/utils/index.ts

@@ -4,7 +4,7 @@ import type { App, Plugin } from 'vue';
 import { unref } from 'vue';
 import { isObject } from '/@/utils/is';
 
-export const noop = () => {};
+export const noop = () => { };
 
 /**
  * @description:  Set ui mount node
@@ -50,7 +50,8 @@ export function openWindow(
   noopener && feature.push('noopener=yes');
   noreferrer && feature.push('noreferrer=yes');
 
-  window.open(url, target, feature.join(','));
+  // window.open(url, target, feature.join(','));//sjl
+  window.open(url, target);
 }
 
 // dynamic use hook props
@@ -71,10 +72,10 @@ export function getRawRoute(route: RouteLocationNormalized): RouteLocationNormal
     ...opt,
     matched: (matched
       ? matched.map((item) => ({
-          meta: item.meta,
-          name: item.name,
-          path: item.path,
-        }))
+        meta: item.meta,
+        name: item.name,
+        path: item.path,
+      }))
       : undefined) as RouteRecordNormalized[],
   };
 }

+ 43 - 0
src/views/app/index.vue

@@ -0,0 +1,43 @@
+<!--
+ * @Author: sjl
+ * @Date: 2023-04-10 11:01:43
+ * @Descripttion: 
+-->
+<template>
+    <div id="twoThree"></div>
+</template>
+<script>
+import { defineComponent, onMounted } from 'vue';
+import MicroFrontend from '/@/utils/MicroFrontend.js';
+import { getAppEnvConfig } from '/@/utils/env';
+import { session } from '/@/utils/Memory.js';
+const { VITE_GLOB_LIGONG_ADMIN } = getAppEnvConfig();
+export default defineComponent({
+    components: {},
+    setup() {
+        var mic = new MicroFrontend().init();
+        onMounted(() => iframe())
+        function iframe() {
+            if (!mic.show) {
+                var token = sessionStorage.getItem('token');
+                var login = session.getItem("loginFrom")
+                if (token && login) {
+                    token = token.replace(/['"]/g, '');
+                    mic.register('wlw', 'twoThree', `http://192.168.49.163:20043/2and3/index.html#/layer?refreshToken=${token}&password=${login.password}&username=${login.username}`);
+                    mic.show = true;
+                }
+            }
+        }
+        return {};
+    }
+});
+</script>
+<style scoped>
+#iframeapp,
+#twoThree,
+#twoThree iframe {
+    width: 100%;
+    height: 100%;
+}
+</style>
+  

+ 2 - 2
src/views/resource/proxy/map.data.ts

@@ -86,12 +86,12 @@ export const columns: BasicColumn[] = [
     width: 160,
   },
   {
-    title: '真实地址',
+    title: '代理地址',
     dataIndex: 'PUBLICCURL',
     width: 160,
   },
   {
-    title: '代理地址',
+    title: '真实地址',
     dataIndex: 'MAPINGURL',
     width: 160,
   },

+ 8 - 1
src/views/twoThree/index.vue

@@ -23,7 +23,14 @@ export default defineComponent({
                 var login = session.getItem("loginFrom")
                 if (token && login) {
                     token = token.replace(/['"]/g, '');
-                    mic.register('wlw', 'twoThree', `${VITE_GLOB_LIGONG_ADMIN}?refreshToken=${token}&password=${login.password}&username=${login.username}`);
+                    var url = null;
+                    if (location.href.indexOf("app/index") > -1) {
+                        // url = `http://192.168.49.163:20043/2and3/index.html#/layer?refreshToken=${token}&password=${login.password}&username=${login.username}`;
+                        url = `${VITE_GLOB_LIGONG_ADMIN}?refreshToken=${token}&password=${login.password}&username=${login.username}`;
+                    } else {
+                        url = `${VITE_GLOB_LIGONG_ADMIN}?refreshToken=${token}&password=${login.password}&username=${login.username}`;
+                    }
+                    mic.register('wlw', 'twoThree', url);
                     mic.show = true;
                 }
             }