ZaiZai 10 months ago
parent
commit
4c1eeb45ab
4 changed files with 66 additions and 1 deletions
  1. 1 1
      public/version.json
  2. 6 0
      src/router/modules/base.js
  3. 1 0
      src/router/modules/token.js
  4. 58 0
      src/views/home/page.vue

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20240428164006"
+  "value": "20240507102231"
 }

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

@@ -36,6 +36,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: '/pdf',
         name: 'pdf',

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

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

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

@@ -0,0 +1,58 @@
+<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)
+
+//渲染完成
+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
+        //缓存数据
+        store.setProjectId(pid)
+        store.setContractId(cid)
+        store.setIsLayout(layout)
+        //跳转
+        setTimeout(() => {
+            loading.value = false
+            router.push({ path: url })
+        }, 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>