|
@@ -51,6 +51,16 @@ export interface CreateRoleDto {
|
|
|
status?: string;
|
|
status?: string;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 更新角色请求参数
|
|
|
|
|
+export interface UpdateRoleDto {
|
|
|
|
|
+ roleId: number;
|
|
|
|
|
+ roleName: string;
|
|
|
|
|
+ menuIds?: number[];
|
|
|
|
|
+ storeId?: number;
|
|
|
|
|
+ description?: string;
|
|
|
|
|
+ remark?: string;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 通用响应接口
|
|
// 通用响应接口
|
|
|
export interface ApiResponse {
|
|
export interface ApiResponse {
|
|
|
code: number;
|
|
code: number;
|
|
@@ -91,7 +101,7 @@ export const createRole = (createRoleDto: CreateRoleDto): Promise<ResultData<Api
|
|
|
return http.post<ApiResponse>(PORT_NONE + `/platform/role/createRole`, createRoleDto, { loading: false });
|
|
return http.post<ApiResponse>(PORT_NONE + `/platform/role/createRole`, createRoleDto, { loading: false });
|
|
|
};
|
|
};
|
|
|
// 编辑角色
|
|
// 编辑角色
|
|
|
-export const updateRole = (updateRoleDto: updateRoleDto): Promise<ResultData<ApiResponse>> => {
|
|
|
|
|
|
|
+export const updateRole = (updateRoleDto: UpdateRoleDto): Promise<ResultData<ApiResponse>> => {
|
|
|
return http.post<ApiResponse>(PORT_NONE + `/platform/role/updateRole`, updateRoleDto, { loading: false });
|
|
return http.post<ApiResponse>(PORT_NONE + `/platform/role/updateRole`, updateRoleDto, { loading: false });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -134,7 +144,7 @@ export const querySubAccounts = (
|
|
|
export const deleteRoleWithCheck = (roleId: number): Promise<ResultData<ApiResponse>> => {
|
|
export const deleteRoleWithCheck = (roleId: number): Promise<ResultData<ApiResponse>> => {
|
|
|
return http.delete<ApiResponse>(PORT_NONE + `/platform/role/deleteRoleWithCheck`, { roleId }, { loading: false });
|
|
return http.delete<ApiResponse>(PORT_NONE + `/platform/role/deleteRoleWithCheck`, { roleId }, { loading: false });
|
|
|
};
|
|
};
|
|
|
-// 分页查询操作记录
|
|
|
|
|
|
|
+// 分页查询操作记录(已废弃,请使用 operationLog)
|
|
|
export const uoperationLogPage = ({
|
|
export const uoperationLogPage = ({
|
|
|
page,
|
|
page,
|
|
|
size,
|
|
size,
|
|
@@ -145,10 +155,10 @@ export const uoperationLogPage = ({
|
|
|
}: {
|
|
}: {
|
|
|
page: number;
|
|
page: number;
|
|
|
size: number;
|
|
size: number;
|
|
|
- operationType: string;
|
|
|
|
|
- operationName: string;
|
|
|
|
|
- operationTime: string;
|
|
|
|
|
- operationContent: string;
|
|
|
|
|
|
|
+ account?: string;
|
|
|
|
|
+ endTime?: string;
|
|
|
|
|
+ module?: string;
|
|
|
|
|
+ startTime?: string;
|
|
|
}): Promise<ResultData<ApiResponse>> => {
|
|
}): Promise<ResultData<ApiResponse>> => {
|
|
|
return http.post<ApiResponse>(
|
|
return http.post<ApiResponse>(
|
|
|
PORT_NONE + `/platform/operationLog/page`,
|
|
PORT_NONE + `/platform/operationLog/page`,
|
|
@@ -170,10 +180,50 @@ export const removeRole = (roleId: number, storeId: number, userId: number): Pro
|
|
|
return http.get<ApiResponse>(PORT_NONE + `/platform/user-role/removeRole`, { roleId, storeId, userId }, { loading: false });
|
|
return http.get<ApiResponse>(PORT_NONE + `/platform/user-role/removeRole`, { roleId, storeId, userId }, { loading: false });
|
|
|
};
|
|
};
|
|
|
// 批量删除子账号 userIds数组 storeId商家id
|
|
// 批量删除子账号 userIds数组 storeId商家id
|
|
|
-export const batchDeleteSubAccounts = ({ storeId, userIds }): Promise<ResultData<ApiResponse>> => {
|
|
|
|
|
|
|
+export const batchDeleteSubAccounts = (storeId: number, userIds: number[]): Promise<ResultData<ApiResponse>> => {
|
|
|
return http.post<ApiResponse>(
|
|
return http.post<ApiResponse>(
|
|
|
PORT_NONE + `/platform/user-role/batchDeleteSubAccounts`,
|
|
PORT_NONE + `/platform/user-role/batchDeleteSubAccounts`,
|
|
|
{ storeId, userIds },
|
|
{ storeId, userIds },
|
|
|
{ loading: false }
|
|
{ loading: false }
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+// 操作记录项接口
|
|
|
|
|
+export interface OperationLogItem {
|
|
|
|
|
+ id: number;
|
|
|
|
|
+ operationModule: string;
|
|
|
|
|
+ operationType: string;
|
|
|
|
|
+ operationContent: string;
|
|
|
|
|
+ operationParams?: string;
|
|
|
|
|
+ operatorId?: string;
|
|
|
|
|
+ operatorAccount?: string;
|
|
|
|
|
+ operatorName?: string;
|
|
|
|
|
+ userType?: string;
|
|
|
|
|
+ requestMethod?: string;
|
|
|
|
|
+ requestPath?: string;
|
|
|
|
|
+ ipAddress?: string;
|
|
|
|
|
+ operationTime: string;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 操作记录分页响应
|
|
|
|
|
+export interface OperationLogPageResponse {
|
|
|
|
|
+ records: OperationLogItem[];
|
|
|
|
|
+ total: number;
|
|
|
|
|
+ size: number;
|
|
|
|
|
+ current: number;
|
|
|
|
|
+ orders: any[];
|
|
|
|
|
+ searchCount: boolean;
|
|
|
|
|
+ pages: number;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// 历史记录列表
|
|
|
|
|
+export const operationLog = (params: {
|
|
|
|
|
+ page: number;
|
|
|
|
|
+ size: number;
|
|
|
|
|
+ account?: string;
|
|
|
|
|
+ endTime?: string;
|
|
|
|
|
+ module?: string;
|
|
|
|
|
+ startTime?: string;
|
|
|
|
|
+}): Promise<ResultData<OperationLogPageResponse>> => {
|
|
|
|
|
+ return http.get<OperationLogPageResponse>(PORT_NONE + `/platform/operationLog/page`, params, { loading: false });
|
|
|
|
|
+};
|