Преглед на файлове

feat: 添加新版A端应用跳转

jiaxing.liao преди 2 седмици
родител
ревизия
891fa8f04d

+ 3 - 0
apps/web-velofex/.env.development

@@ -14,3 +14,6 @@ VITE_DEVTOOLS=false
 
 # 是否注入全局loading
 VITE_INJECT_APP_LOADING=true
+
+# vue-router 的模式
+VITE_ROUTER_HISTORY=hash

+ 5 - 0
apps/web-velofex/src/router/routes/external/router-a.ts

@@ -82,6 +82,11 @@ const routes: RouteRecordRaw[] = [
       },
     ],
   },
+  {
+    name: 'JumpToEnterprise',
+    path: '/jumpToEnterprise',
+    component: () => import('#/views/jump-to-enterprise/index.vue'),
+  },
 ];
 
 export default routes;

+ 1 - 1
apps/web-velofex/src/views/dashboard/application-management/index.vue

@@ -220,7 +220,7 @@ async function deleteApplication(item: any) {
 }
 
 function handleClick(item: UserApi.ApplicationModel) {
-  window.open(`/jumpToEnterprise?enterpriseCode=${item.code}`, '_blank');
+  window.open(`/#/jumpToEnterprise?enterpriseCode=${item.code}`, '_blank');
 }
 
 watch(

+ 1 - 1
apps/web-velofex/src/views/dashboard/home/application-management.vue

@@ -70,7 +70,7 @@ function handleMore() {
 }
 
 function handleClick(item: UserApi.ApplicationModel) {
-  window.open(`/jumpToEnterprise?enterpriseCode=${item.code}`, '_blank');
+  window.open(`/#/jumpToEnterprise?enterpriseCode=${item.code}`, '_blank');
 }
 
 watch(

+ 1 - 1
apps/web-velofex/src/views/dashboard/home/product-list.vue

@@ -65,7 +65,7 @@ function handleMore() {
 }
 
 function handleClick(item: UserApi.ApplicationModel) {
-  window.open(`/jumpToEnterprise?enterpriseCode=${item.code}`, '_blank');
+  window.open(`/#/jumpToEnterprise?enterpriseCode=${item.code}`, '_blank');
 }
 
 watch(

+ 21 - 0
apps/web-velofex/src/views/jump-to-enterprise/index.vue

@@ -0,0 +1,21 @@
+<script setup lang="ts">
+import { computed } from 'vue';
+import { useRoute } from 'vue-router';
+
+const route = useRoute();
+// @ts-ignore
+window.BACKEND_VERSION = 'V2';
+
+const url = computed(() => {
+  const token = localStorage.getItem('token_a');
+  return `/api/enterpriselogin/doLoginByToken?enterpriseCode=${route.query?.enterpriseCode || ''}&token=${token || ''}`;
+});
+</script>
+
+<template>
+  <iframe
+    id="jumpIF"
+    :src="url"
+    style="width: 100vw; height: 100vh; border: 0"
+  ></iframe>
+</template>

+ 3 - 0
apps/webB-velofex/.env.development

@@ -14,3 +14,6 @@ VITE_DEVTOOLS=false
 
 # 是否注入全局loading
 VITE_INJECT_APP_LOADING=true
+
+# vue-router 的模式
+VITE_ROUTER_HISTORY=hash

+ 0 - 1
apps/webB-velofex/src/router/guard.ts

@@ -31,7 +31,6 @@ export function createRouterGuard(to: RouteLocationNormalized) {
   }
 
   const enterpriseCode = resolveEnterpriseCodeFromLocation();
-
   if (!enterpriseCode) {
     return {
       path: '/error',