From 1d37c375fd114212ee1419c3bbdadc81d76666a4 Mon Sep 17 00:00:00 2001
From: yearning <10538594+wangweifeng1999@user.noreply.gitee.com>
Date: 星期四, 03 九月 2026 18:01:59 +0800
Subject: [PATCH] 优化

---
 src/views/h5/index.vue |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/src/views/h5/index.vue b/src/views/h5/index.vue
index fd2c39d..f892066 100644
--- a/src/views/h5/index.vue
+++ b/src/views/h5/index.vue
@@ -5,7 +5,7 @@
 </template>
 <script>
 import { useSessionStore } from '@/stores/session.js'
-import { storeToRefs } from 'pinia';
+import { storeToRefs } from 'pinia'
 export default {
   setup() {
     const { setUserInfo } = useSessionStore()
@@ -15,10 +15,22 @@
   data() {
     return {}
   },
+  computed: {
+
+  },
   created() {
-    if (this.$route.path == '/h5/verify' && this.$route.query.appId) {
-      localStorage.setItem('verify_url', this.$route.fullPath)
+    const path = this.$route.path
+    const regionCode = this.$route.query.regionCode //鏈娇鐢�
+    const fullPath = this.$route.fullPath
+    let personType = null
+    if (path == '/h5/addrVer') { //0==宸ヤ綔浜哄憳 2==鑰冪偣鏍搁獙鍛�
+      personType = '2'
+    } else if (path == '/h5/staffSignIn') {
+      personType = '0'
     }
+    localStorage.setItem('_personType', personType)
+    localStorage.setItem('_regionCode', regionCode)
+    localStorage.setItem('_enterUrl', fullPath)
     this.getUserInfo()
   },
   methods: {
@@ -26,9 +38,17 @@
       this.$axios.get('/system/auth/staff/profile').then(res => {
         if (res.data.code == 0) {
           this.setUserInfo(res.data.data || {})
+        } else if (res.data.code != 401) {
+          const tip = res.data.msg || '鑾峰彇璐﹀彿淇℃伅寮傚父'
+          this.$message.error(tip)
+          this.$router.replace({ path: '/h5/noTask', query: { tip } })
         }
+      }).catch(() => {
+        const tip = '鑾峰彇璐﹀彿淇℃伅寮傚父'
+        this.$router.replace({ path: '/h5/noTask', query: { tip }})
+        this.$message.error(tip)
       })
     },
   }
 }
-</script>
\ No newline at end of file
+</script>

--
Gitblit v1.8.0