Эх сурвалжийг харах

修改人脸识别内容判断

yuanmingze 3 сар өмнө
parent
commit
4ab917229f

+ 5 - 5
src/stores/modules/user.ts

@@ -5,7 +5,7 @@ interface UserState {
   access_token: string
   tenant_id: string
   pushRecordId: string
-  areaCode: string
+  needFaceId: boolean
 }
 
 export const useUserStore = defineStore('user', {
@@ -13,7 +13,7 @@ export const useUserStore = defineStore('user', {
     access_token: '',
     tenant_id: '1',
     pushRecordId: '',
-    areaCode: '',
+    needFaceId: false,
   }),
 
   actions: {
@@ -23,13 +23,13 @@ export const useUserStore = defineStore('user', {
     setPushRecordId(id: string) {
       this.pushRecordId = id
     },
-    setAreaCode(code: string) {
-      this.areaCode = code
+    setNeedFaceId(flag: boolean) {
+      this.needFaceId = flag
     },
     LogOut() {
       this.access_token = ''
       this.pushRecordId = ''
-      this.areaCode = ''
+      this.needFaceId = false
     },
   },
 

+ 2 - 2
src/views/identity-upload/index.vue

@@ -79,7 +79,7 @@ import { useUserStore } from '@/stores/modules/user'
 // ✅ 使用封装好的 Hook
 import { useInvoice } from '@/hooks/useInvoice'
 import type { UpdateH5IdcardInfoRequest } from '@/services/modules/identityUpload/type.d'
-import { areaCode } from '@/constants/faceRecognitionArea'
+
 // --- 初始化 Hooks ---
 const { getStatus, submitInvoiceApply } = useInvoice()
 const userStore = useUserStore()
@@ -196,7 +196,7 @@ const handleNext = async () => {
     if (res.code === 0) {
       // 需要人脸识别->跳转人脸识别
       // 已处理状态,跳转人脸识别
-      if (areaCode.includes(userStore.areaCode)) {
+      if (userStore.needFaceId) {
         return router.push({ path: '/face-recognition' })
       }
       // 其他情况,直接提交

+ 1 - 2
src/views/invoice-information/index.vue

@@ -130,7 +130,6 @@ import StepProgress from '@/components/StepProgress.vue'
 import { getConfirmInvoiceInfoApi } from '@/services/modules/invoiceInformation'
 import type { PushRecordIdRequest } from '@/services/modules/invoiceInformation/type.d.ts'
 import { useUserStore } from '@/stores/modules/user'
-import { areaCode } from '@/constants/faceRecognitionArea'
 
 // ✅ 使用封装好的 Hook
 import { useInvoice } from '@/hooks/useInvoice'
@@ -176,7 +175,7 @@ const handleNext = async () => {
   }
 
   // 已处理状态,跳转人脸识别
-  if (areaCode.includes(userStore.areaCode)) {
+  if (userStore.needFaceId) {
     return router.push({ path: '/face-recognition' })
   }
 

+ 1 - 1
src/views/login/index.vue

@@ -289,7 +289,7 @@ const getPubName = async () => {
     if (res.code === 0) {
       pubName.value = res.data.projectName
       registerUrlParams.value.areaId = res.data.cityCode
-      userStore.setAreaCode(res.data.provinceCode)
+      userStore.setNeedFaceId(res.data.needFaceId)
       registerUrlParams.value.pushRecordId = sendEtsSms.pushRecordId
     }
   } catch (err) {