Bläddra i källkod

解决重定向问题

yuanmingze 2 månader sedan
förälder
incheckning
576ef8211e

+ 1 - 1
src/hooks/useInvoice.ts

@@ -97,7 +97,7 @@ export function useInvoice() {
     // 5. 失败后统一处理 —— 判断当前页面是否需要跳转
     if (route.path !== '/h5/invoice-information/index') {
       setTimeout(() => {
-        router.replace('/h5/invoice-information/index')
+        router.replace('/invoice-information/index')
       }, 1800)
     }
   }

+ 4 - 1
src/services/request/index.ts

@@ -98,11 +98,13 @@ const handleNetworkError = (response: AxiosResponse, silent?: boolean) => {
 
   const userStore = useUserStoreWithOut()
 
+  console.log('response', response)
+
   // 先处理401登录失效问题
   if (status === 401) {
     showToast('您的登录状态已失效,请重新登录')
     abortAllRequests()
-    useUserStoreWithOut().LogOut()
+
     // 🔁 跳转到登录页
     setTimeout(() => {
       router.replace({
@@ -111,6 +113,7 @@ const handleNetworkError = (response: AxiosResponse, silent?: boolean) => {
           pushRecordId: userStore.pushRecordId,
         },
       })
+      useUserStoreWithOut().LogOut()
     }, 1500)
   }
 

+ 2 - 1
src/views/pedding-face-recognition/index.vue

@@ -45,6 +45,7 @@ const getFaceAuthResult = async () => {
       // 已认证或无需认证提交跳转
       if (rzzt === 'NO_REQUIRED_AUTHENTICATION') {
         submitInvoiceApply()
+        return
       }
     } else {
       showToast('扫脸认证失败,请重试')
@@ -55,7 +56,7 @@ const getFaceAuthResult = async () => {
   }
 
   setTimeout(() => {
-    router.replace('/h5/invoice-information/index')
+    router.replace('/invoice-information/index')
   }, 1800)
 }