Browse Source

更新信息新增用户名、添加推送id

yuanmingze 3 months ago
parent
commit
222bbb191c

+ 5 - 2
src/services/modules/faceRecognition/index.ts

@@ -1,13 +1,16 @@
 import http from '../../index'
 
-export const getFaceAuthInfoApi = () => {
+import type { PushRecordIdRequest } from '../invoiceInformation/type.d'
+export const getFaceAuthInfoApi = (data: PushRecordIdRequest) => {
   return http.post({
     url: '/admin/invoice-order/get-face-auth-info',
+    data,
   })
 }
 
-export const getFaceAuthResultApi = () => {
+export const getFaceAuthResultApi = (data: PushRecordIdRequest) => {
   return http.post({
     url: '/admin/invoice-order/get-face-auth-result',
+    data,
   })
 }

+ 4 - 0
src/services/modules/identityUpload/type.d.ts

@@ -33,6 +33,10 @@ export interface UpdateH5IdcardInfoRequest {
    * 身份证有效期开始时间
    */
   idcardPeriodStart: string
+  /**
+   * 姓名
+   */
+  name: string
   /**
    * 推送记录id
    */

+ 10 - 3
src/views/face-recognition/index.vue

@@ -25,17 +25,24 @@
 <script setup lang="ts">
 import StepProgress from '@/components/StepProgress.vue'
 import { getFaceAuthInfoApi, getFaceAuthResultApi } from '@/services/modules/faceRecognition'
-import { ref, onBeforeMount, onMounted, onUnmounted } from 'vue'
+import { ref, reactive, onBeforeMount, onMounted, onUnmounted } from 'vue'
 import { showToast } from 'vant'
 import { useInvoice } from '@/hooks/useInvoice'
+import { useUserStore } from '@/stores/modules/user'
+import type { PushRecordIdRequest } from '@/services/modules/invoiceInformation/type.d.ts'
 
+const userStore = useUserStore()
 const etsUrl = ref('')
 
+const params = reactive<PushRecordIdRequest>({
+  pushRecordId: userStore.pushRecordId,
+})
+
 // --- 初始化 Hooks ---
 const { submitInvoiceApply } = useInvoice()
 // 获取认证链接
 const getConfirmInvoiceInfo = async () => {
-  const res = await getFaceAuthInfoApi()
+  const res = await getFaceAuthInfoApi(params)
   if (res.code === 0 && res.data?.faceAuthUrl) {
     etsUrl.value = res.data.faceAuthUrl
   } else {
@@ -46,7 +53,7 @@ const getConfirmInvoiceInfo = async () => {
 // 获取认证结果
 const getFaceAuthResult = async () => {
   try {
-    const res = await getFaceAuthResultApi()
+    const res = await getFaceAuthResultApi(params)
     if (res.code === 0 && res.data?.success) {
       submitInvoiceApply()
     } else {

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

@@ -145,6 +145,7 @@ const handleOcrCheck = async (side: 'front' | 'back', file: File) => {
       if (side === 'front') {
         submitInfo.idCard = res.data.idcard
         submitInfo.idCardFrontImg = res.data.imgUrl
+        submitInfo.name = res.data.realname
       } else {
         submitInfo.idcardPeriodStart = res.data.begin
         submitInfo.idcardPeriodEnd = res.data.end
@@ -162,6 +163,7 @@ const handleOcrCheck = async (side: 'front' | 'back', file: File) => {
 const submitInfo = reactive<UpdateH5IdcardInfoRequest>({
   pushRecordId: userStore.pushRecordId,
   idCard: '',
+  name: '',
   idcardPeriodStart: '',
   idcardPeriodEnd: '',
   idCardFrontImg: '',