- 在所有信用模块的搜索参数接口中添加 userId 字段 - 集成 withCreditUserScope 数据范围工具函数到各个 API 请求 - 实现对行政许可、破产重整、分支机构、失信被执行人等所有信用数据的用户范围过滤 - 统一处理分页和列表查询的数据范围限制 - 确保所有信用相关 API 都支持基于用户的权限控制
30 lines
770 B
TypeScript
30 lines
770 B
TypeScript
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));
|
||
}
|
||
|