26 lines
1.2 KiB
JavaScript
26 lines
1.2 KiB
JavaScript
// 人脸识别接口 mock(凡荣e链222005 透传接口的本地模拟)。
|
|
// 与 customer.js 的区别:本文件**不挂载 requireAuth**——该接口同时被管理后台"个人开户"表单
|
|
// (已登录,携带 Authorization)与 fryl_h5 个人开户移动端H5确认页(匿名,不携带 Authorization)
|
|
// 调用,若挂在带 requireAuth 的 customer.js 里,H5 侧调用会被鉴权中间件拦截返回401。
|
|
// 详见 docs/superpowers/specs/2026-07-31-personal-open-mobile-h5-face-recognize-and-field-sync-design.md
|
|
import express from 'express'
|
|
import { nextId } from '../utils/id.js'
|
|
import { sendOk, sendFail } from '../utils/response.js'
|
|
|
|
const router = express.Router()
|
|
|
|
router.post('/customer-info/personal/face-recognize', (req, res) => {
|
|
const { fileData, idNo, name } = req.body || {}
|
|
if (!fileData || !idNo || !name) return sendFail(res, 'fileData/idNo/name不能为空', 400)
|
|
const fileNo = `FACE${String(nextId('file')).padStart(8, '0')}`
|
|
sendOk(res, {
|
|
fileNo,
|
|
recode: '0000',
|
|
recodeInfo: '识别通过',
|
|
sysSerialNo: `${Date.now()}`,
|
|
sysDate: new Date().toISOString().slice(0, 10).replace(/-/g, '')
|
|
})
|
|
})
|
|
|
|
export default router
|