Преглед изворни кода

修改退出登录、人脸跳转

yuanmingze пре 3 месеци
родитељ
комит
33b423e6d4
2 измењених фајлова са 17 додато и 6 уклоњено
  1. 1 0
      src/stores/modules/user.ts
  2. 16 6
      src/views/invoice-information/index.vue

+ 1 - 0
src/stores/modules/user.ts

@@ -23,6 +23,7 @@ export const useUserStore = defineStore('user', {
     },
     LogOut() {
       this.access_token = ''
+      this.pushRecordId = ''
     },
   },
 

+ 16 - 6
src/views/invoice-information/index.vue

@@ -109,6 +109,7 @@
       <van-button
         type="primary"
         block
+        :disabled="btnDisabled"
         round
         color="linear-gradient(90deg, #ff7a00, #ffa94d)"
         class="next-btn"
@@ -154,6 +155,7 @@ const params = reactive<PushRecordIdRequest>({
   pushRecordId: userStore.pushRecordId,
 })
 
+const btnDisabled = ref(false)
 const getConfirmInvoiceInfo = async () => {
   try {
     loading.value = true
@@ -163,8 +165,10 @@ const getConfirmInvoiceInfo = async () => {
     }
   } catch (err: any) {
     const { code, message } = err
+    // 如果存在错误码,则显示错误信息,且按钮禁用点击
     if (code === 1 && message) {
       showToast(message)
+      // btnDisabled.value = true
     }
   } finally {
     loading.value = false
@@ -174,17 +178,19 @@ const getConfirmInvoiceInfo = async () => {
 const handleNext = useDebounceFn(async () => {
   const res = await getStatusApi(params)
   if (res.code === 0) {
-    if (!res.data.eventStatus) {
+    //  res.data.eventStatus === 'PROCESSED' 去人脸识别页面
+    if (res.data.eventStatus === 'PROCESSED') {
       return router.push({
         path: '/face-recognition',
       })
     }
+    return submitInvoiceApply()
     // 当前账户没有身份照片,跳转上传证件页面
-    if (!res.data.isIdImgReady) {
-      router.push({
-        path: '/identity-upload',
-      })
-    }
+    // if (!res.data.isIdImgReady) {
+    //   router.push({
+    //     path: '/identity-upload',
+    //   })
+    // }
   }
 }, 1000)
 
@@ -205,6 +211,10 @@ const submitInvoiceApply = async () => {
 const activeStep = ref(1)
 const onConfirm = () => {
   showDialog.value = false
+  userStore.LogOut()
+  router.replace({
+    path: '/login',
+  })
 }
 
 const toDetail = () => {