添加读取本地文件功能,支持以 base64 格式返回身份证照片;更新客户信息接口,支持上传婚姻状况及相关信息

This commit is contained in:
yuchenglong
2025-12-09 13:55:46 +08:00
parent 88f8896a68
commit 81724a778f
8 changed files with 313 additions and 42 deletions

14
src/utils/idCard.ts Normal file
View File

@@ -0,0 +1,14 @@
export function parseRegionCodesFromId(idNo: string | null | undefined) {
const result = { province: "", city: "", county: "" };
if (!idNo) return result;
const s = String(idNo).trim();
// 身份证号码前6位为行政区划代码
if (!/^[0-9]{6,}/.test(s)) return result;
const first6 = s.slice(4, 6);
const first4 = s.slice(2, 4);
const first2 = s.slice(0, 2);
result.county = first6;
result.city = `${first4}`;
result.province = `${first2}`;
return result;
}