|
|
@@ -56,11 +56,14 @@
|
|
|
<script setup lang="ts">
|
|
|
import { computed } from 'vue'
|
|
|
|
|
|
-// import { personVerifyFaceApi } from '@/services/modules/auth'
|
|
|
+import { gigCertPersonVerifyFaceApi } from '@/services/modules/auth'
|
|
|
+
|
|
|
import { useUserStore } from '@/stores/modules/user'
|
|
|
|
|
|
type LivenessReminderType = 'expiring' | 'expired' | ''
|
|
|
|
|
|
+const FACE_AUTH_URL = '/pages-auth/face/index'
|
|
|
+
|
|
|
const props = withDefaults(
|
|
|
defineProps<{
|
|
|
modelValue: boolean
|
|
|
@@ -120,23 +123,36 @@ const handleGoAuth = async () => {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- // const res = await personVerifyFaceApi({
|
|
|
- // cardId: idCardNumber,
|
|
|
- // realName: realname,
|
|
|
- // })
|
|
|
+ const res = await gigCertPersonVerifyFaceApi({
|
|
|
+ cardId: idCardNumber,
|
|
|
+ realName: realname,
|
|
|
+ })
|
|
|
|
|
|
- // if (res.code !== 0 || !res.data?.serialNo || !res.data?.faceUrl) return
|
|
|
+ if (res.code !== 0 || !res.data?.serialNo || !res.data?.faceUrl) return
|
|
|
|
|
|
- // show.value = false
|
|
|
+ show.value = false
|
|
|
+
|
|
|
+ uni.navigateTo({
|
|
|
+ url: buildFaceAuthUrl({
|
|
|
+ serialNo: res.data.serialNo,
|
|
|
+ faceUrl: res.data.faceUrl,
|
|
|
+ realName: realname,
|
|
|
+ cardId: idCardNumber,
|
|
|
+ }),
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
- // uni.navigateTo({
|
|
|
- // url:
|
|
|
- // `/pages-sub-verify/auth/face-auth` +
|
|
|
- // `?serialNo=${res.data.serialNo}` +
|
|
|
- // `&faceUrl=${encodeURIComponent(res.data.faceUrl)}` +
|
|
|
- // `&realName=${encodeURIComponent(realname)}` +
|
|
|
- // `&cardId=${encodeURIComponent(idCardNumber)}`,
|
|
|
- // })
|
|
|
+const buildFaceAuthUrl = (params: {
|
|
|
+ serialNo: string
|
|
|
+ faceUrl: string
|
|
|
+ realName: string
|
|
|
+ cardId: string
|
|
|
+}) => {
|
|
|
+ const query = Object.entries(params)
|
|
|
+ .map(([key, value]) => `${key}=${encodeURIComponent(value)}`)
|
|
|
+ .join('&')
|
|
|
+
|
|
|
+ return `${FACE_AUTH_URL}?${query}`
|
|
|
}
|
|
|
</script>
|
|
|
|