refactor: 统一权限标识前缀为module_格式

feat(tenant): 新增租户管理模块相关文件

style: 优化代码导入和类型提示

fix: 修复前端权限标识校验逻辑

docs: 更新注释中的权限标识示例

test: 更新测试用例中的权限标识

chore: 清理无用导入和类型定义
This commit is contained in:
zhangtao
2025-11-11 01:06:40 +08:00
parent 379df71baa
commit 5d0d0cd26a
54 changed files with 2109 additions and 445 deletions
+113
View File
@@ -0,0 +1,113 @@
import request from "@/utils/request";
const API_PATH = "/system/tenant";
const TenantAPI = {
list(query: ObjPageQuery) {
return request<ApiResponse<PageResult<ObjTable[]>>>({
url: `${API_PATH}/list`,
method: "get",
params: query,
});
},
detail(query: number) {
return request<ApiResponse<ObjTable>>({
url: `${API_PATH}/detail/${query}`,
method: "get",
});
},
create(body: ObjForm) {
return request<ApiResponse>({
url: `${API_PATH}/create`,
method: "post",
data: body,
});
},
update(id: number, body: ObjForm) {
return request<ApiResponse>({
url: `${API_PATH}/update/${id}`,
method: "put",
data: body,
});
},
delete(body: number[]) {
return request<ApiResponse>({
url: `${API_PATH}/delete`,
method: "delete",
data: body,
});
},
batch(body: BatchType) {
return request<ApiResponse>({
url: `${API_PATH}/available/setting`,
method: "patch",
data: body,
});
},
export(body: ObjPageQuery) {
return request<Blob>({
url: `${API_PATH}/export`,
method: "post",
data: body,
responseType: "blob",
});
},
download() {
return request<ApiResponse>({
url: `${API_PATH}/download/template`,
method: "post",
responseType: "blob",
});
},
import(body: FormData) {
return request<ApiResponse>({
url: `${API_PATH}/import`,
method: "post",
data: body,
headers: {
"Content-Type": "multipart/form-data",
},
});
},
};
export default TenantAPI;
export interface ObjPageQuery extends PageQuery {
/** 示例标题 */
name?: string;
/** 示例状态 */
status?: boolean;
/** 开始时间 */
start_time?: string;
/** 结束时间 */
end_time?: string;
/** 创建人 */
creator?: number;
}
export interface ObjTable {
index?: number;
id?: number;
name?: string;
status?: boolean;
description?: string;
created_at?: string;
updated_at?: string;
// creator?: creatorType;
}
export interface ObjForm {
id?: number;
name?: string;
status?: boolean;
description?: string;
}