Compare commits
3 Commits
f2d6b029f1
...
d4e7a163f7
| Author | SHA1 | Date | |
|---|---|---|---|
| d4e7a163f7 | |||
| a8688c0f4a | |||
| 16b7e2fb61 |
@@ -44,7 +44,18 @@
|
||||
"usedAt": 1775972794982,
|
||||
"industryId": "all"
|
||||
}
|
||||
],
|
||||
"e1bb762122264b5d9d218f575fecf04b": [
|
||||
{
|
||||
"expertId": "SeniorDeveloper",
|
||||
"name": "Will",
|
||||
"profession": "高级开发工程师",
|
||||
"avatarUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/avatars/02-Engineering/SeniorDeveloper/SeniorDeveloper.png",
|
||||
"promptUrl": "https://acc-1258344699.cos.accelerate.myqcloud.com/workbuddy/experts/experts/02-Engineering/SeniorDeveloper/SeniorDeveloper_zh.md",
|
||||
"usedAt": 1776019266960,
|
||||
"industryId": "all"
|
||||
}
|
||||
]
|
||||
},
|
||||
"lastUpdated": 1775994576652
|
||||
"lastUpdated": 1776019986045
|
||||
}
|
||||
35
.workbuddy/memory/2026-04-13.md
Normal file
35
.workbuddy/memory/2026-04-13.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# 2026-04-13 工作日志
|
||||
|
||||
## 完成的工作
|
||||
|
||||
### 1. 阿里云实人认证接入
|
||||
**目的**:为 user/userVerify 页面添加阿里云身份证二要素核验
|
||||
|
||||
**后端改动**(JAVA/websopy-java):
|
||||
- pom.xml:添加 `com.aliyun:cloudauth20190307:2.2.4` 依赖
|
||||
- application.yml:添加 `cloudauth` 配置项(accessKeyId、accessKeySecret、endpoint、regionId)
|
||||
- 新增 `CloudAuthProperties.java`:配置属性类
|
||||
- 新增 `IdVerificationService.java`:实人认证服务
|
||||
- 新增 `IdVerificationController.java`:实人认证 API 控制器
|
||||
|
||||
**前端改动**(VUE/websopy-mp):
|
||||
- api/system/userVerify/index.ts:添加 `verifyIdCard()` API 调用
|
||||
- user/userVerify/index.tsx:
|
||||
- 导入 verifyIdCard
|
||||
- 修改 submitSucceed 函数:个人认证时先调用实名校验,核验通过后再提交
|
||||
|
||||
### 2. 调研结论
|
||||
- **城市服务实名校验**:已于2021年11月停止开放,不可用
|
||||
- **阿里云实人认证**:推荐方案,0.2元/次,有100次免费试用额度
|
||||
- **接入方式**:身份证二要素核验(姓名+身份证号)最简单
|
||||
|
||||
## 待办事项
|
||||
- [x] 配置阿里云 AccessKey(在 application-prod.yml 中设置 cloudauth.accessKeyId 和 cloudauth.accessKeySecret)
|
||||
- [ ] 在阿里云实人认证控制台开通服务并充值
|
||||
- [ ] 测试验证接口是否正常工作
|
||||
|
||||
## 阿里云 AccessKey 配置
|
||||
- 项目:websopy-java
|
||||
- 文件:application-prod.yml
|
||||
- accessKeyId: LTAI4GKGZ9Z2Z8JZ77c3GNZP
|
||||
- 备注:与 OSS 使用同一个 AccessKey
|
||||
@@ -128,3 +128,24 @@ export async function submit(data: UserVerify) {
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 阿里云实人认证 - 身份证二要素核验
|
||||
* 验证姓名和身份证号是否一致
|
||||
*/
|
||||
export async function verifyIdCard(realName: string, idCard: string) {
|
||||
const res = await request.post<ApiResult<{
|
||||
success: boolean;
|
||||
isMatch: boolean;
|
||||
bizCode: string;
|
||||
message: string;
|
||||
}>>(
|
||||
SERVER_API_URL + '/id-verification/verify-id-card',
|
||||
null,
|
||||
{ params: { realName, idCard } }
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: '开发者中心',
|
||||
navigationStyle: 'custom',
|
||||
usingComponents: {},
|
||||
})
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
// 复用 developer/app/api-keys/index.scss 的样式
|
||||
@import '../../developer/app/api-keys/index';
|
||||
@import '../../app/api-keys/index';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: '企业控制台',
|
||||
navigationStyle: 'custom',
|
||||
usingComponents: {},
|
||||
})
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
Checkbox,
|
||||
} from '@nutui/nutui-react-taro'
|
||||
import {UserVerify} from "@/api/system/userVerify/model";
|
||||
import {addUserVerify, myUserVerify, updateUserVerify} from "@/api/system/userVerify";
|
||||
import {addUserVerify, myUserVerify, updateUserVerify, verifyIdCard} from "@/api/system/userVerify";
|
||||
import {uploadFile} from "@/api/system/file";
|
||||
|
||||
function Index() {
|
||||
@@ -62,7 +62,7 @@ function Index() {
|
||||
};
|
||||
|
||||
// 提交表单
|
||||
const submitSucceed = (values: any) => {
|
||||
const submitSucceed = async (values: any) => {
|
||||
console.log('提交表单', values);
|
||||
if (FormData.status != 2 && FormData.status != undefined) return false;
|
||||
|
||||
@@ -113,6 +113,36 @@ function Index() {
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
// 个人认证:先调用阿里云实人认证进行身份核验
|
||||
if (FormData.type == 0) {
|
||||
Taro.showLoading({ title: '身份核验中...' });
|
||||
try {
|
||||
const verifyResult = await verifyIdCard(FormData.realName!, FormData.idCard!);
|
||||
Taro.hideLoading();
|
||||
|
||||
if (!verifyResult.isMatch) {
|
||||
Taro.showToast({
|
||||
title: '身份信息不一致,请核实后重新填写',
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
// 核验通过,继续提交
|
||||
} catch (error: any) {
|
||||
Taro.hideLoading();
|
||||
console.error('身份核验失败', error);
|
||||
Taro.showToast({
|
||||
title: error.message || '身份核验失败,请稍后重试',
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const saveOrUpdate = isUpdate ? updateUserVerify : addUserVerify;
|
||||
saveOrUpdate({...FormData, status: 0}).then(() => {
|
||||
Taro.showToast({title: `提交成功`, icon: 'success'})
|
||||
|
||||
Reference in New Issue
Block a user