Files
mp-10579/src/api/credit/companyId.ts
赵忠林 6b21547b09 feat(credit): 添加用户数据范围控制功能
- 在所有信用模块的搜索参数接口中添加 userId 字段
- 集成 withCreditUserScope 数据范围工具函数到各个 API 请求
- 实现对行政许可、破产重整、分支机构、失信被执行人等所有信用数据的用户范围过滤
- 统一处理分页和列表查询的数据范围限制
- 确保所有信用相关 API 都支持基于用户的权限控制
2026-01-21 13:15:48 +08:00

30 lines
770 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import request from '@/utils/request';
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
import type { ApiResult } from '@/api';
/**
* 修正某个信用模块数据的主体企业归属(按名称匹配回填 companyId
*
* 后端约定: POST /api/credit/{module}/company-id/refresh
* 例如: module = "credit-judgment-debtor"
*/
export async function refreshCreditCompanyId(
module: string,
params?: {
onlyNull?: boolean;
limit?: number;
}
) {
const res = await request.post<ApiResult<unknown>>(
`/credit/${module}/company-id/refresh`,
undefined,
{ params: withCreditUserScope(params) }
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}