ZaiZai 1 год назад
Родитель
Сommit
e99c88ff2e
4 измененных файлов с 68 добавлено и 2 удалено
  1. 2 2
      src/config/index.json
  2. 6 0
      src/router/modules/base.js
  3. 1 0
      src/router/modules/token.js
  4. 59 0
      src/views/home/page.vue

+ 2 - 2
src/config/index.json

@@ -1,7 +1,7 @@
 {
     "version": "20230607160059",
-    "target": "http://192.168.0.102:8090",
-    "target1": "http://39.108.216.210:8090",
+    "target1": "http://192.168.0.102:8090",
+    "target": "http://39.108.216.210:8090",
     "smsPhone": "",
     "vite": {
         "port": 5174,

+ 6 - 0
src/router/modules/base.js

@@ -35,6 +35,12 @@ export default [
         meta: { title: '授权登录' },
         component: () => import('~src/views/home/auth.vue'),
     },
+    {
+        path: '/auth-page',
+        name: 'auth-page',
+        meta: { title: '页面跳转' },
+        component: () => import('~src/views/home/page.vue'),
+    },
     {
         path: '/app/table-form',
         name: 'app-table-form',

+ 1 - 0
src/router/modules/token.js

@@ -1,5 +1,6 @@
 //内置路由需要验证的
 export default [
+    'auth-page',
     'home',
     'home-index',
     'home-index-static',

+ 59 - 0
src/views/home/page.vue

@@ -0,0 +1,59 @@
+<template>
+    <div v-loading="loading" class="hc-body-loading" element-loading-text="加载中...">
+        <div v-if="isErrorShow" class="error-page">
+            <div :style="`background-image: url(${svgdev});`" class="img" />
+            <div class="content">
+                <h1>300</h1>
+                <div class="desc">请先指定要跳转的地址</div>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script setup>
+import { onMounted, ref } from 'vue'
+import { useAppStore } from '~src/store'
+import { useRoute, useRouter } from 'vue-router'
+import { getObjValue, isNullES } from 'js-fast-way'
+import svgdev from '~ass/view/dev.svg'
+
+//初始变量
+const router = useRouter()
+const useRoutes = useRoute()
+const store = useAppStore()
+
+//变量
+const loading = ref(true)
+const isErrorShow = ref(false)
+const toUrl = ref('/home/index')
+
+//渲染完成
+onMounted(() => {
+    // http://质检的域名/#/auth-page?pid=xxx&cid=xxx&layout=no&url=xxx
+    const { pid, cid, layout, url } = getObjValue(useRoutes.query)
+    if (!isNullES(url)) {
+        isErrorShow.value = false
+        toUrl.value = url ?? '/home/index'
+        //缓存数据
+        store.setProjectId(pid)
+        store.setContractId(cid)
+        store.setIsLayout(layout)
+        //跳转
+        setTimeout(() => {
+            router.push({ path: toUrl.value })
+        }, 200)
+    } else {
+        loading.value = false
+        isErrorShow.value = true
+    }
+})
+</script>
+
+<style lang="scss" scoped>
+@import "../../styles/error/style.scss";
+.hc-body-loading {
+    position: relative;
+    height: 100%;
+    width: 100%;
+}
+</style>