feat(credit): 添加用户数据范围控制功能
- 在所有信用模块的搜索参数接口中添加 userId 字段 - 集成 withCreditUserScope 数据范围工具函数到各个 API 请求 - 实现对行政许可、破产重整、分支机构、失信被执行人等所有信用数据的用户范围过滤 - 统一处理分页和列表查询的数据范围限制 - 确保所有信用相关 API 都支持基于用户的权限控制
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
import { withCreditUserScope } from '@/api/credit/utils/data-scope';
|
||||
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
CreditSuspectedRelationship,
|
||||
@@ -13,9 +15,7 @@ export async function pageCreditSuspectedRelationship(
|
||||
) {
|
||||
const res = await request.get<
|
||||
ApiResult<PageResult<CreditSuspectedRelationship>>
|
||||
>('/credit/credit-suspected-relationship/page', {
|
||||
params
|
||||
});
|
||||
>('/credit/credit-suspected-relationship/page', { params: withCreditUserScope(params) });
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
@@ -30,9 +30,7 @@ export async function listCreditSuspectedRelationship(
|
||||
) {
|
||||
const res = await request.get<ApiResult<CreditSuspectedRelationship[]>>(
|
||||
'/credit/credit-suspected-relationship',
|
||||
{
|
||||
params
|
||||
}
|
||||
{ params: withCreditUserScope(params) }
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
|
||||
Reference in New Issue
Block a user