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 |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/src/views/h5/index.vue b/src/views/h5/index.vue
index f66d1e8..f892066 100644
--- a/src/views/h5/index.vue
+++ b/src/views/h5/index.vue
@@ -5,8 +5,7 @@
 </template>
 <script>
 import { useSessionStore } from '@/stores/session.js'
-import { storeToRefs } from 'pinia';
-import { tokenUtils } from '@/utils/axios.js'
+import { storeToRefs } from 'pinia'
 export default {
   setup() {
     const { setUserInfo } = useSessionStore()
@@ -17,11 +16,11 @@
     return {}
   },
   computed: {
-    
+
   },
   created() {
-    const path = this.$route.path 
-    const regionCode = this.$route.query.regionCode
+    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==鑰冪偣鏍搁獙鍛�
@@ -32,10 +31,6 @@
     localStorage.setItem('_personType', personType)
     localStorage.setItem('_regionCode', regionCode)
     localStorage.setItem('_enterUrl', fullPath)
-    // const lastPersonType = localStorage.getItem('_personType')
-    // if (lastPersonType && lastPersonType !== personType) {
-    //   tokenUtils.clearTokens()
-    // }
     this.getUserInfo()
   },
   methods: {
@@ -43,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