feat(api): 优化用户审核接口实现

- 修改用户审核请求为 PUT 方法,统一传递参数对象
- 支持通过(status 1)或拒绝(status 2)两种审核状态
- 审核拒绝时添加驳回原因字段
- 详细说明参数含义及使用方式
This commit is contained in:
2026-07-11 23:59:13 +08:00
parent bf259ea8ff
commit 423d82d9c6

View File

@@ -295,14 +295,18 @@ export async function exportUsers(params?: UserParam) {
} }
/** /**
* 审核用户 * 审核用户(通过/拒绝)
* @param id 用户id * @param id 用户id
* @param data 审核结果 * @param data 审核结果 { status: 1通过|2拒绝, remark?: 驳回原因 }
*/ */
export async function auditUser(id: number, data: UserAuditRequest) { export async function auditUser(id: number, data: UserAuditRequest) {
const res = await request.post<ApiResult<unknown>>( const res = await request.put<ApiResult<unknown>>(
SERVER_API_URL + '/system/user/audit/' + id, SERVER_API_URL + '/system/user/audit',
data {
userId: id,
auditStatus: data.status,
rejectReason: data.status === 2 ? data.remark : null
}
); );
if (res.data.code === 0) { if (res.data.code === 0) {
return res.data.message; return res.data.message;