mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-24 05:26:58 +00:00
refactor(api): 统一API路径常量并优化前端代码结构
feat(backend): 更新路由前缀和查询参数处理 style(backend): 调整导入顺序和清理无用导入 refactor(frontend): 重构工作台页面交互和样式 fix(frontend): 修复代码生成页面查询表单和表格展示
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/application/myapp";
|
||||
|
||||
export const ApplicationAPI = {
|
||||
/**
|
||||
* 获取应用详情
|
||||
@@ -7,7 +9,7 @@ export const ApplicationAPI = {
|
||||
*/
|
||||
getApplicationDetail(id: number) {
|
||||
return request<ApiResponse<ApplicationInfo>>({
|
||||
url: `/application/application/detail/${id}`,
|
||||
url: `${API_PATH}/detail/${id}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
@@ -18,7 +20,7 @@ export const ApplicationAPI = {
|
||||
*/
|
||||
getApplicationList(query: ApplicationPageQuery) {
|
||||
return request<ApiResponse<PageResult<ApplicationInfo[]>>>({
|
||||
url: `/application/application/list`,
|
||||
url: `${API_PATH}/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -30,7 +32,7 @@ export const ApplicationAPI = {
|
||||
*/
|
||||
createApplication(body: ApplicationForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/application/application/create`,
|
||||
url: `${API_PATH}/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -43,7 +45,7 @@ export const ApplicationAPI = {
|
||||
*/
|
||||
updateApplication(id: number, body: ApplicationForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/application/application/update/${id}`,
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
@@ -55,7 +57,7 @@ export const ApplicationAPI = {
|
||||
*/
|
||||
deleteApplication(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/application/application/delete`,
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
@@ -67,7 +69,7 @@ export const ApplicationAPI = {
|
||||
*/
|
||||
batchAvailableApplication(body: BatchType) {
|
||||
return request<ApiResponse>({
|
||||
url: `/application/application/available/setting`,
|
||||
url: `${API_PATH}/available/setting`,
|
||||
method: "patch",
|
||||
data: body,
|
||||
});
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/example/demo";
|
||||
|
||||
const ExampleAPI = {
|
||||
getExampleList(query: ExamplePageQuery) {
|
||||
return request<ApiResponse<PageResult<ExampleTable[]>>>({
|
||||
url: `/example/demo/list`,
|
||||
url: `${API_PATH}/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -11,14 +13,14 @@ const ExampleAPI = {
|
||||
|
||||
getExampleDetail(query: number) {
|
||||
return request<ApiResponse<ExampleTable>>({
|
||||
url: `/example/demo/detail/${query}`,
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createExample(body: ExampleForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/example/demo/create`,
|
||||
url: `${API_PATH}/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -26,7 +28,7 @@ const ExampleAPI = {
|
||||
|
||||
updateExample(id: number, body: ExampleForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/example/demo/update/${id}`,
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
@@ -34,7 +36,7 @@ const ExampleAPI = {
|
||||
|
||||
deleteExample(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/example/demo/delete`,
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
@@ -42,7 +44,7 @@ const ExampleAPI = {
|
||||
|
||||
batchAvailableExample(body: BatchType) {
|
||||
return request<ApiResponse>({
|
||||
url: `/example/demo/available/setting`,
|
||||
url: `${API_PATH}/available/setting`,
|
||||
method: "patch",
|
||||
data: body,
|
||||
});
|
||||
@@ -50,7 +52,7 @@ const ExampleAPI = {
|
||||
|
||||
exportExample(body: ExamplePageQuery) {
|
||||
return request<Blob>({
|
||||
url: `/example/demo/export`,
|
||||
url: `${API_PATH}/export`,
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: "blob",
|
||||
@@ -59,7 +61,7 @@ const ExampleAPI = {
|
||||
|
||||
downloadTemplate() {
|
||||
return request<ApiResponse>({
|
||||
url: `/example/demo/download/template`,
|
||||
url: `${API_PATH}/download/template`,
|
||||
method: "post",
|
||||
responseType: "blob",
|
||||
});
|
||||
@@ -67,7 +69,7 @@ const ExampleAPI = {
|
||||
|
||||
importExample(body: any) {
|
||||
return request<ApiResponse>({
|
||||
url: `/example/demo/import`,
|
||||
url: `${API_PATH}/import`,
|
||||
method: "post",
|
||||
data: body,
|
||||
headers: {
|
||||
|
||||
@@ -1,39 +1,38 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const GENERATOR_BASE_URL = "/gencode";
|
||||
const API_PATH = "/generator/gencode";
|
||||
|
||||
const GencodeAPI = {
|
||||
|
||||
// 查询生成表数据
|
||||
listTable(query: TablePageQuery) {
|
||||
return request<PageResult<GenTableOutVO>>({
|
||||
url: `${GENERATOR_BASE_URL}/list`,
|
||||
return request<ApiResponse<PageResult<GenTableOutVO>>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
},
|
||||
|
||||
// 查询db数据库列表
|
||||
listDbTable(query: TablePageQuery) {
|
||||
return request<PageResult<TablePageVO>>({
|
||||
url: `${GENERATOR_BASE_URL}/db/list`,
|
||||
listDbTable(query: DBTablePageQuery) {
|
||||
return request<ApiResponse<PageResult<TablePageVO>>>({
|
||||
url: `${API_PATH}/db/list`,
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
},
|
||||
|
||||
// 查询表详细信息
|
||||
getGenTableDetail(tableId: number) {
|
||||
return request<GenTableDetailResult>({
|
||||
url: `${GENERATOR_BASE_URL}/detail/${tableId}`,
|
||||
getGenTableDetail(table_id: number) {
|
||||
return request<ApiResponse<GenTableDetailResult>>({
|
||||
url: `${API_PATH}/detail/${table_id}`,
|
||||
method: 'get'
|
||||
})
|
||||
},
|
||||
|
||||
// 创建表
|
||||
createTable(sql: string) {
|
||||
return request({
|
||||
url: `${GENERATOR_BASE_URL}/create`,
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/create`,
|
||||
method: 'post',
|
||||
params: { sql }
|
||||
})
|
||||
@@ -41,8 +40,8 @@ const GencodeAPI = {
|
||||
|
||||
// 修改代码生成信息
|
||||
updateGenTable(data: GenTableUpdateSchema) {
|
||||
return request({
|
||||
url: `${GENERATOR_BASE_URL}/update`,
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/update`,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
@@ -50,8 +49,8 @@ const GencodeAPI = {
|
||||
|
||||
// 导入表
|
||||
importTable(tables: string[]) {
|
||||
return request({
|
||||
url: `${GENERATOR_BASE_URL}/import`,
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/import`,
|
||||
method: 'post',
|
||||
data: { tables }
|
||||
})
|
||||
@@ -60,16 +59,16 @@ const GencodeAPI = {
|
||||
|
||||
// 预览生成代码
|
||||
previewTable(tableId: number) {
|
||||
return request<GeneratorPreviewVO[]>({
|
||||
url: `${GENERATOR_BASE_URL}/preview/${tableId}`,
|
||||
return request<ApiResponse<GeneratorPreviewVO[]>>({
|
||||
url: `${API_PATH}/preview/${tableId}`,
|
||||
method: 'get'
|
||||
})
|
||||
},
|
||||
|
||||
// 删除表数据
|
||||
deleteTable(tableIds: number[]) {
|
||||
return request({
|
||||
url: `${GENERATOR_BASE_URL}/delete`,
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: 'delete',
|
||||
data: tableIds
|
||||
})
|
||||
@@ -78,7 +77,7 @@ const GencodeAPI = {
|
||||
// 批量生成代码
|
||||
batchGenCode(tables: string) {
|
||||
return request<Blob>({
|
||||
url: `${GENERATOR_BASE_URL}/batch/out`,
|
||||
url: `${API_PATH}/batch/out`,
|
||||
method: 'patch',
|
||||
params: { tables },
|
||||
responseType: 'blob'
|
||||
@@ -87,16 +86,16 @@ const GencodeAPI = {
|
||||
|
||||
// 生成代码到指定路径
|
||||
genCodeToPath(tableName: string) {
|
||||
return request({
|
||||
url: `${GENERATOR_BASE_URL}/out/path/${tableName}`,
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/out/path/${tableName}`,
|
||||
method: 'post'
|
||||
})
|
||||
},
|
||||
|
||||
// 同步数据库
|
||||
syncDb(tableName: string) {
|
||||
return request({
|
||||
url: `${GENERATOR_BASE_URL}/sync/db/${tableName}`,
|
||||
return request<ApiResponse>({
|
||||
url: `${API_PATH}/sync/db/${tableName}`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
@@ -109,33 +108,45 @@ export interface GeneratorPreviewVO {
|
||||
/** 文件生成路径 */
|
||||
path: string;
|
||||
/** 文件名称 */
|
||||
fileName: string;
|
||||
file_name: string;
|
||||
/** 文件内容 */
|
||||
content: string;
|
||||
}
|
||||
|
||||
/** 数据表分页查询参数 */
|
||||
export interface TablePageQuery extends PageQuery {
|
||||
/** 关键字(表名) */
|
||||
keywords?: string;
|
||||
/** 表名称 */
|
||||
table_name?: string;
|
||||
/** 表描述 */
|
||||
table_comment?: string;
|
||||
/** 开始时间 */
|
||||
start_time?: string;
|
||||
/** 结束时间 */
|
||||
end_time?: string;
|
||||
}
|
||||
|
||||
/** 数据库表分页查询参数 */
|
||||
export interface DBTablePageQuery extends PageQuery {
|
||||
/** 数据库列名称 */
|
||||
column_name?: string;
|
||||
}
|
||||
|
||||
/** 数据表分页对象 */
|
||||
export interface TablePageVO {
|
||||
/** 表名称 */
|
||||
tableName: string;
|
||||
table_name: string;
|
||||
|
||||
/** 表描述 */
|
||||
tableComment: string;
|
||||
table_comment: string;
|
||||
|
||||
/** 存储引擎 */
|
||||
engine: string;
|
||||
|
||||
/** 字符集排序规则 */
|
||||
tableCollation: string;
|
||||
table_collation: string;
|
||||
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
create_time: string;
|
||||
}
|
||||
|
||||
/** 代码生成表输出对象 */
|
||||
@@ -143,45 +154,45 @@ export interface GenTableOutVO {
|
||||
/** 主键 */
|
||||
id?: number;
|
||||
/** 表名称 */
|
||||
tableName: string;
|
||||
table_name: string;
|
||||
/** 表描述 */
|
||||
tableComment: string;
|
||||
table_comment: string;
|
||||
/** 关联子表的表名 */
|
||||
subTableName?: string;
|
||||
sub_table_name?: string;
|
||||
/** 子表关联的外键名 */
|
||||
subTableFkName: string;
|
||||
sub_table_fk_name: string;
|
||||
/** 实体类名称 */
|
||||
className: string;
|
||||
class_name: string;
|
||||
/** 使用的模板(crud单表操作 tree树表操作) */
|
||||
tplCategory?: string;
|
||||
tpl_category?: string;
|
||||
/** 前端模板类型(element-ui模版 element-plus模版) */
|
||||
tplWebType?: string;
|
||||
tpl_web_type?: string;
|
||||
/** 生成包路径 */
|
||||
packageName: string;
|
||||
package_name: string;
|
||||
/** 生成模块名 */
|
||||
moduleName: string;
|
||||
module_name: string;
|
||||
/** 生成业务名 */
|
||||
businessName: string;
|
||||
business_name: string;
|
||||
/** 生成功能名 */
|
||||
functionName: string;
|
||||
function_name: string;
|
||||
/** 生成功能作者 */
|
||||
functionAuthor?: string;
|
||||
function_author?: string;
|
||||
/** 生成代码方式(0zip压缩包 1自定义路径) */
|
||||
genType?: string;
|
||||
gen_type?: string;
|
||||
/** 生成路径(不填默认项目路径) */
|
||||
genPath?: string;
|
||||
gen_path?: string;
|
||||
/** 其它生成选项 */
|
||||
options?: string;
|
||||
/** 树编码字段 */
|
||||
treeCode?: string;
|
||||
tree_code?: string;
|
||||
/** 树父编码字段 */
|
||||
treeParentCode?: string;
|
||||
tree_parent_code?: string;
|
||||
/** 树名称字段 */
|
||||
treeName?: string;
|
||||
tree_name?: string;
|
||||
/** 上级菜单ID字段 */
|
||||
parentMenuId?: number;
|
||||
parent_menu_id?: number;
|
||||
/** 上级菜单名称字段 */
|
||||
parentMenuName?: string;
|
||||
parent_menu_name?: string;
|
||||
/** 是否为子表 */
|
||||
sub?: boolean;
|
||||
/** 是否为树表 */
|
||||
@@ -193,9 +204,9 @@ export interface GenTableOutVO {
|
||||
/** 代码生成表更新模型 */
|
||||
export interface GenTableUpdateSchema extends GenTableOutVO {
|
||||
/** 主键信息 */
|
||||
pkColumn?: GenTableColumnUpdateSchema;
|
||||
pk_column?: GenTableColumnUpdateSchema;
|
||||
/** 子表信息 */
|
||||
subTable?: GenTableUpdateSchema;
|
||||
sub_table?: GenTableUpdateSchema;
|
||||
/** 表列信息 */
|
||||
columns: GenTableColumnUpdateSchema[];
|
||||
}
|
||||
@@ -205,43 +216,43 @@ export interface GenTableColumnUpdateSchema {
|
||||
/** 主键 */
|
||||
id?: number;
|
||||
/** 归属表编号 */
|
||||
tableId?: number;
|
||||
table_id?: number;
|
||||
/** 列名称 */
|
||||
columnName: string;
|
||||
column_name: string;
|
||||
/** 列描述 */
|
||||
columnComment?: string;
|
||||
column_comment?: string;
|
||||
/** 列类型 */
|
||||
columnType: string;
|
||||
column_type: string;
|
||||
/** PYTHON类型 */
|
||||
pythonType?: string;
|
||||
python_type?: string;
|
||||
/** PYTHON字段名 */
|
||||
pythonField: string;
|
||||
python_field: string;
|
||||
/** 是否主键(1是) */
|
||||
isPk?: string;
|
||||
is_pk?: string;
|
||||
/** 是否自增(1是) */
|
||||
isIncrement?: string;
|
||||
is_increment?: string;
|
||||
/** 是否必填(1是) */
|
||||
isRequired?: string;
|
||||
is_required?: string;
|
||||
/** 是否唯一(1是) */
|
||||
isUnique?: string;
|
||||
is_unique?: string;
|
||||
/** 是否为插入字段(1是) */
|
||||
isInsert?: string;
|
||||
is_insert?: string;
|
||||
/** 是否编辑字段(1是) */
|
||||
isEdit?: string;
|
||||
is_edit?: string;
|
||||
/** 是否列表字段(1是) */
|
||||
isList?: string;
|
||||
is_list?: string;
|
||||
/** 是否查询字段(1是) */
|
||||
isQuery?: string;
|
||||
is_query?: string;
|
||||
/** 查询方式(等于、不等于、大于、小于、范围) */
|
||||
queryType?: string;
|
||||
query_type?: string;
|
||||
/** 显示类型(文本框、文本域、下拉框、复选框、单选框、日期控件) */
|
||||
htmlType: string;
|
||||
html_type: string;
|
||||
/** 字典类型 */
|
||||
dictType: string;
|
||||
dict_type: string;
|
||||
/** 排序 */
|
||||
sort?: number;
|
||||
/** 字段大写形式 */
|
||||
capPythonField?: string;
|
||||
cap_python_field?: string;
|
||||
/** 是否主键 */
|
||||
pk?: boolean;
|
||||
/** 是否自增 */
|
||||
@@ -259,9 +270,9 @@ export interface GenTableColumnUpdateSchema {
|
||||
/** 是否查询字段 */
|
||||
query?: boolean;
|
||||
/** 是否为基类字段 */
|
||||
superColumn?: boolean;
|
||||
super_column?: boolean;
|
||||
/** 是否为基类字段白名单 */
|
||||
usableColumn?: boolean;
|
||||
usable_column?: boolean;
|
||||
}
|
||||
|
||||
/** 表详情查询结果 */
|
||||
|
||||
@@ -1,51 +1,53 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/monitor/cache";
|
||||
|
||||
const CacheAPI = {
|
||||
getCacheInfo() {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/cache/info`,
|
||||
url: `${API_PATH}/info`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
getCacheNames() {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/cache/get/names`,
|
||||
url: `${API_PATH}/get/names`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
getCacheKeys(cacheName: string) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/cache/get/keys/${cacheName}`,
|
||||
url: `${API_PATH}/get/keys/${cacheName}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
getCacheValue(cacheName: string, cacheKey: string) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/cache/get/value/${cacheName}/${cacheKey}`,
|
||||
url: `${API_PATH}/get/value/${cacheName}/${cacheKey}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
deleteCacheName(cacheName: string) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/cache/delete/name/${cacheName}`,
|
||||
url: `${API_PATH}/delete/name/${cacheName}`,
|
||||
method: "delete",
|
||||
});
|
||||
},
|
||||
|
||||
deleteCacheKey(cacheKey: string) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/cache/delete/key/${cacheKey}`,
|
||||
url: `${API_PATH}/delete/key/${cacheKey}`,
|
||||
method: "delete",
|
||||
});
|
||||
},
|
||||
|
||||
deleteCacheAll() {
|
||||
return request<ApiResponse>({
|
||||
url: "/monitor/cache/delete/all",
|
||||
url: `${API_PATH}/delete/all`,
|
||||
method: "delete",
|
||||
});
|
||||
},
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/monitor/job";
|
||||
|
||||
const JobAPI = {
|
||||
getJobList(query: JobPageQuery) {
|
||||
return request<ApiResponse<PageResult<JobTable[]>>>({
|
||||
url: `/monitor/job/list`,
|
||||
url: `${API_PATH}/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -11,14 +13,14 @@ const JobAPI = {
|
||||
|
||||
getJobDetail(query: number) {
|
||||
return request<ApiResponse<JobTable>>({
|
||||
url: `/monitor/job/detail/${query}`,
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createJob(body: JobForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/job/create`,
|
||||
url: `${API_PATH}/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -26,7 +28,7 @@ const JobAPI = {
|
||||
|
||||
updateJob(id: number, body: JobForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/job/update/${id}`,
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
@@ -34,7 +36,7 @@ const JobAPI = {
|
||||
|
||||
deleteJob(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/job/delete`,
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
@@ -42,7 +44,7 @@ const JobAPI = {
|
||||
|
||||
exportJob(body: JobPageQuery) {
|
||||
return request<Blob>({
|
||||
url: `/monitor/job/export`,
|
||||
url: `${API_PATH}/export`,
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: "blob",
|
||||
@@ -51,14 +53,14 @@ const JobAPI = {
|
||||
|
||||
clearJob() {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/job/clear`,
|
||||
url: `${API_PATH}/clear`,
|
||||
method: "delete",
|
||||
});
|
||||
},
|
||||
|
||||
OptionJob(params: JobOptionData) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/job/option`,
|
||||
url: `${API_PATH}/option`,
|
||||
method: "put",
|
||||
data: params,
|
||||
});
|
||||
@@ -67,7 +69,7 @@ const JobAPI = {
|
||||
// 获取定时任务运行日志(实时状态)
|
||||
getJobRunLog() {
|
||||
return request<ApiResponse<JobRunLog[]>>({
|
||||
url: `/monitor/job/log`,
|
||||
url: `${API_PATH}/log`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
@@ -75,7 +77,7 @@ const JobAPI = {
|
||||
// 获取定时任务日志详情
|
||||
getJobLogDetail(id: number) {
|
||||
return request<ApiResponse<JobLogDetail>>({
|
||||
url: `/monitor/job/log/detail/${id}`,
|
||||
url: `${API_PATH}/log/detail/${id}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
@@ -83,7 +85,7 @@ const JobAPI = {
|
||||
// 查询定时任务日志列表
|
||||
getJobLogList(query: JobLogPageQuery) {
|
||||
return request<ApiResponse<PageResult<JobLogTable[]>>>({
|
||||
url: `/monitor/job/log/list`,
|
||||
url: `${API_PATH}/log/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -92,7 +94,7 @@ const JobAPI = {
|
||||
// 删除定时任务日志
|
||||
deleteJobLog(ids: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/job/log/delete`,
|
||||
url: `${API_PATH}/log/delete`,
|
||||
method: "delete",
|
||||
data: ids,
|
||||
});
|
||||
@@ -101,7 +103,7 @@ const JobAPI = {
|
||||
// 清空定时任务日志
|
||||
clearJobLog() {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/job/log/clear`,
|
||||
url: `${API_PATH}/log/clear`,
|
||||
method: "delete",
|
||||
});
|
||||
},
|
||||
@@ -109,7 +111,7 @@ const JobAPI = {
|
||||
// 导出定时任务日志
|
||||
exportJobLog(query: JobLogPageQuery) {
|
||||
return request<Blob>({
|
||||
url: `/monitor/job/log/export`,
|
||||
url: `${API_PATH}/log/export`,
|
||||
method: "post",
|
||||
data: query,
|
||||
responseType: "blob",
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/monitor/online";
|
||||
|
||||
const OnlineAPI = {
|
||||
// 查询在线用户列表
|
||||
getOnlineList(query: OnlineUserPageQuery) {
|
||||
return request<ApiResponse<PageResult<OnlineUserTable[]>>>({
|
||||
url: `/monitor/online/list`,
|
||||
url: `${API_PATH}/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -13,7 +15,7 @@ const OnlineAPI = {
|
||||
// 强退用户
|
||||
deleteOnline(body: string) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/online/delete`,
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
@@ -22,7 +24,7 @@ const OnlineAPI = {
|
||||
// 强退用户
|
||||
clearOnline() {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/online/clear`,
|
||||
url: `${API_PATH}/clear`,
|
||||
method: "delete",
|
||||
});
|
||||
},
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/monitor/resource";
|
||||
|
||||
export const ResourceAPI = {
|
||||
/**
|
||||
* 获取目录列表
|
||||
@@ -7,7 +9,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
getResourceList(query: ResourcePageQuery) {
|
||||
return request<ApiResponse<PageResult<ResourceItem[]>>>({
|
||||
url: `/monitor/resource/list`,
|
||||
url: `${API_PATH}/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -20,7 +22,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
uploadFile(formData: FormData) {
|
||||
return request<ApiResponse<ResourceUploadSchema>>({
|
||||
url: `/monitor/resource/upload`,
|
||||
url: `${API_PATH}/upload`,
|
||||
method: "post",
|
||||
data: formData,
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
@@ -33,7 +35,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
downloadFile(path: string) {
|
||||
return request<Blob>({
|
||||
url: `/monitor/resource/download`,
|
||||
url: `${API_PATH}/download`,
|
||||
method: "get",
|
||||
params: { path },
|
||||
responseType: "blob",
|
||||
@@ -46,7 +48,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
deleteResource(body: string[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/resource/delete`,
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
@@ -58,7 +60,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
moveResource(body: ResourceMoveQuery) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/resource/move`,
|
||||
url: `${API_PATH}/move`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -70,7 +72,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
copyResource(body: ResourceCopyQuery) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/resource/copy`,
|
||||
url: `${API_PATH}/copy`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -82,7 +84,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
renameResource(body: ResourceRenameQuery) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/resource/rename`,
|
||||
url: `${API_PATH}/rename`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -94,7 +96,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
createDirectory(body: ResourceCreateDirQuery) {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/resource/create-dir`,
|
||||
url: `${API_PATH}/create-dir`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -106,7 +108,7 @@ export const ResourceAPI = {
|
||||
*/
|
||||
exportResource(body: ResourcePageQuery) {
|
||||
return request<Blob>({
|
||||
url: `/monitor/resource/export`,
|
||||
url: `${API_PATH}/export`,
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: "blob",
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/monitor/server";
|
||||
|
||||
const ServerAPI = {
|
||||
// 获取服务信息
|
||||
getServer() {
|
||||
return request<ApiResponse>({
|
||||
url: `/monitor/server/info`,
|
||||
url: `${API_PATH}/info`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/system/auth";
|
||||
|
||||
const AuthAPI = {
|
||||
login(body: LoginFormData) {
|
||||
return request<ApiResponse<LoginResult>>({
|
||||
url: `/system/auth/login`,
|
||||
url: `${API_PATH}/login`,
|
||||
method: "post",
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
@@ -14,7 +16,7 @@ const AuthAPI = {
|
||||
|
||||
refreshToken(body: RefreshToekenBody) {
|
||||
return request<ApiResponse<LoginResult>>({
|
||||
url: `/system/auth/token/refresh`,
|
||||
url: `${API_PATH}/token/refresh`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -22,14 +24,14 @@ const AuthAPI = {
|
||||
|
||||
getCaptcha() {
|
||||
return request<ApiResponse<CaptchaInfo>>({
|
||||
url: `/system/auth/captcha/get`,
|
||||
url: `${API_PATH}/captcha/get`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
logout(body: LogoutBody) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/auth/logout`,
|
||||
url: `${API_PATH}/logout`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/system/dept";
|
||||
|
||||
const DeptAPI = {
|
||||
getDeptList(query?: DeptPageQuery) {
|
||||
return request<ApiResponse<DeptTable[]>>({
|
||||
url: `/system/dept/tree`,
|
||||
url: `${API_PATH}/tree`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -11,14 +13,14 @@ const DeptAPI = {
|
||||
|
||||
getDeptDetail(query: number) {
|
||||
return request<ApiResponse<DeptTable>>({
|
||||
url: `/system/dept/detail/${query}`,
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createDept(body: DeptForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/dept/create`,
|
||||
url: `${API_PATH}/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -26,7 +28,7 @@ const DeptAPI = {
|
||||
|
||||
updateDept(id: number, body: DeptForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/dept/update/${id}`,
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
@@ -34,7 +36,7 @@ const DeptAPI = {
|
||||
|
||||
deleteDept(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/dept/delete`,
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
@@ -42,7 +44,7 @@ const DeptAPI = {
|
||||
|
||||
batchAvailableDept(body: BatchType) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/dept/available/setting`,
|
||||
url: `${API_PATH}/available/setting`,
|
||||
method: "patch",
|
||||
data: body,
|
||||
});
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/system/dict";
|
||||
|
||||
const DictAPI = {
|
||||
getDictTypeList(query: DictPageQuery) {
|
||||
return request<ApiResponse<PageResult<DictTable[]>>>({
|
||||
url: `/system/dict/type/list`,
|
||||
url: `${API_PATH}/type/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -11,21 +13,21 @@ const DictAPI = {
|
||||
|
||||
getDictTypeOptionselect() {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/dict/type/optionselect`,
|
||||
url: `${API_PATH}/type/optionselect`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
getDictTypeDetail(query: number) {
|
||||
return request<ApiResponse<DictTable>>({
|
||||
url: `/system/dict/type/detail/${query}`,
|
||||
url: `${API_PATH}/type/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createDictType(body: DictForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/dict/type/create`,
|
||||
url: `${API_PATH}/type/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -33,7 +35,7 @@ const DictAPI = {
|
||||
|
||||
updateDictType(id: number, body: DictForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/dict/type/update/${id}`,
|
||||
url: `${API_PATH}/type/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
@@ -41,7 +43,7 @@ const DictAPI = {
|
||||
|
||||
deleteDictType(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/dict/type/delete`,
|
||||
url: `${API_PATH}/type/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
@@ -49,7 +51,7 @@ const DictAPI = {
|
||||
|
||||
batchAvailableDict(body: BatchType) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/dict/type/available/setting`,
|
||||
url: `${API_PATH}/type/available/setting`,
|
||||
method: "patch",
|
||||
data: body,
|
||||
});
|
||||
@@ -57,7 +59,7 @@ const DictAPI = {
|
||||
|
||||
exportDictType(body: DictPageQuery) {
|
||||
return request<Blob>({
|
||||
url: `/system/dict/type/export`,
|
||||
url: `${API_PATH}/type/export`,
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: "blob",
|
||||
@@ -66,7 +68,7 @@ const DictAPI = {
|
||||
|
||||
getDictDataList(query: DictDataPageQuery) {
|
||||
return request<ApiResponse<PageResult<DictDataTable[]>>>({
|
||||
url: `/system/dict/data/list`,
|
||||
url: `${API_PATH}/data/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -74,14 +76,14 @@ const DictAPI = {
|
||||
|
||||
getDictDataDetail(query: number) {
|
||||
return request<ApiResponse<DictDataTable>>({
|
||||
url: `/system/dict/data/detail/${query}`,
|
||||
url: `${API_PATH}/data/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createDictData(body: DictDataForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/dict/data/create`,
|
||||
url: `${API_PATH}/data/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -89,7 +91,7 @@ const DictAPI = {
|
||||
|
||||
updateDictData(id: number, body: DictDataForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/dict/data/update/${id}`,
|
||||
url: `${API_PATH}/data/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
@@ -97,7 +99,7 @@ const DictAPI = {
|
||||
|
||||
deleteDictData(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/dict/data/delete`,
|
||||
url: `${API_PATH}/data/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
@@ -105,7 +107,7 @@ const DictAPI = {
|
||||
|
||||
batchAvailableDictData(body: BatchType) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/dict/data/available/setting`,
|
||||
url: `${API_PATH}/data/available/setting`,
|
||||
method: "patch",
|
||||
data: body,
|
||||
});
|
||||
@@ -113,7 +115,7 @@ const DictAPI = {
|
||||
|
||||
exportDictData(body: DictDataPageQuery) {
|
||||
return request<Blob>({
|
||||
url: `/system/dict/data/export`,
|
||||
url: `${API_PATH}/data/export`,
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: "blob",
|
||||
@@ -122,7 +124,7 @@ const DictAPI = {
|
||||
|
||||
getInitDict(dict_type: string) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/dict/data/info/${dict_type}`,
|
||||
url: `${API_PATH}/data/info/${dict_type}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/system/log";
|
||||
|
||||
const LogAPI = {
|
||||
getLogList(query: LogPageQuery) {
|
||||
return request<ApiResponse<PageResult<LogTable[]>>>({
|
||||
url: `/system/log/list`,
|
||||
url: `${API_PATH}/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -11,14 +13,14 @@ const LogAPI = {
|
||||
|
||||
getLogDetail(query: number) {
|
||||
return request<ApiResponse<LogTable>>({
|
||||
url: `/system/log/detail/${query}`,
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
deleteLog(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/log/delete`,
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
@@ -26,7 +28,7 @@ const LogAPI = {
|
||||
|
||||
exportLog(body: LogPageQuery) {
|
||||
return request<Blob>({
|
||||
url: `/system/log/export`,
|
||||
url: `${API_PATH}/export`,
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: "blob",
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/system/menu";
|
||||
|
||||
const MenuAPI = {
|
||||
getMenuList(query?: MenuPageQuery) {
|
||||
return request<ApiResponse<MenuTable[]>>({
|
||||
url: `/system/menu/tree`,
|
||||
url: `${API_PATH}/tree`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -11,14 +13,14 @@ const MenuAPI = {
|
||||
|
||||
getMenuDetail(query: number) {
|
||||
return request<ApiResponse<MenuTable>>({
|
||||
url: `/system/menu/detail/${query}`,
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createMenu(body: MenuForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/menu/create`,
|
||||
url: `${API_PATH}/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -26,7 +28,7 @@ const MenuAPI = {
|
||||
|
||||
updateMenu(id: number, body: MenuForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/menu/update/${id}`,
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
@@ -34,7 +36,7 @@ const MenuAPI = {
|
||||
|
||||
deleteMenu(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/menu/delete`,
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
@@ -42,7 +44,7 @@ const MenuAPI = {
|
||||
|
||||
batchAvailableMenu(body: BatchType) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/menu/available/setting`,
|
||||
url: `${API_PATH}/available/setting`,
|
||||
method: "patch",
|
||||
data: body,
|
||||
});
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/system/notice";
|
||||
|
||||
const NoticeAPI = {
|
||||
getNoticeList(query: NoticePageQuery) {
|
||||
return request<ApiResponse<PageResult<NoticeTable[]>>>({
|
||||
url: `/system/notice/list`,
|
||||
url: `${API_PATH}/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -11,21 +13,21 @@ const NoticeAPI = {
|
||||
|
||||
getNoticeListAvailable() {
|
||||
return request<ApiResponse<PageResult<NoticeTable[]>>>({
|
||||
url: `/system/notice/available`,
|
||||
url: `${API_PATH}/available`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
getNoticeDetail(query: number) {
|
||||
return request<ApiResponse<NoticeTable>>({
|
||||
url: `/system/notice/detail/${query}`,
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createNotice(body: NoticeForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/notice/create`,
|
||||
url: `${API_PATH}/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -33,7 +35,7 @@ const NoticeAPI = {
|
||||
|
||||
updateNotice(id: number, body: NoticeForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/notice/update/${id}`,
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
@@ -41,7 +43,7 @@ const NoticeAPI = {
|
||||
|
||||
deleteNotice(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/notice/delete`,
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
@@ -49,7 +51,7 @@ const NoticeAPI = {
|
||||
|
||||
batchAvailableNotice(body: BatchType) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/notice/available/setting`,
|
||||
url: `${API_PATH}/available/setting`,
|
||||
method: "patch",
|
||||
data: body,
|
||||
});
|
||||
@@ -57,7 +59,7 @@ const NoticeAPI = {
|
||||
|
||||
exportNotice(body: NoticePageQuery) {
|
||||
return request<Blob>({
|
||||
url: `/system/notice/export`,
|
||||
url: `${API_PATH}/export`,
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: "blob",
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/system/param";
|
||||
|
||||
const ParamsAPI = {
|
||||
uploadFile(body: any) {
|
||||
return request<ApiResponse<UploadFilePath>>({
|
||||
url: `/system/param/upload`,
|
||||
url: `${API_PATH}/upload`,
|
||||
method: "post",
|
||||
data: body,
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
@@ -12,14 +14,14 @@ const ParamsAPI = {
|
||||
|
||||
getInitConfig() {
|
||||
return request<ApiResponse<ConfigTable[]>>({
|
||||
url: `/system/param/info`,
|
||||
url: `${API_PATH}/info`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
getConfigList(query: ConfigPageQuery) {
|
||||
return request<ApiResponse<PageResult<ConfigTable[]>>>({
|
||||
url: `/system/param/list`,
|
||||
url: `${API_PATH}/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -27,14 +29,14 @@ const ParamsAPI = {
|
||||
|
||||
getConfigDetail(query: number) {
|
||||
return request<ApiResponse<ConfigTable>>({
|
||||
url: `/system/param/detail/${query}`,
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createConfig(body: ConfigForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/param/create`,
|
||||
url: `${API_PATH}/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -42,7 +44,7 @@ const ParamsAPI = {
|
||||
|
||||
updateConfig(id: number, body: ConfigForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/param/update/${id}`,
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
@@ -50,7 +52,7 @@ const ParamsAPI = {
|
||||
|
||||
deleteConfig(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/param/delete`,
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
@@ -58,7 +60,7 @@ const ParamsAPI = {
|
||||
|
||||
exportConfig(body: ConfigPageQuery) {
|
||||
return request<Blob>({
|
||||
url: `/system/param/export`,
|
||||
url: `${API_PATH}/export`,
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: "blob",
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/system/position";
|
||||
|
||||
const PositionAPI = {
|
||||
getPositionList(query?: PositionPageQuery) {
|
||||
return request<ApiResponse<PageResult<PositionTable[]>>>({
|
||||
url: `/system/position/list`,
|
||||
url: `${API_PATH}/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -11,14 +13,14 @@ const PositionAPI = {
|
||||
|
||||
getPositionDetail(query: number) {
|
||||
return request<ApiResponse<PositionTable>>({
|
||||
url: `/system/position/detail/${query}`,
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createPosition(body: PositionForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/position/create`,
|
||||
url: `${API_PATH}/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -26,7 +28,7 @@ const PositionAPI = {
|
||||
|
||||
updatePosition(id: number, body: PositionForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/position/update/${id}`,
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
@@ -34,7 +36,7 @@ const PositionAPI = {
|
||||
|
||||
deletePosition(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/position/delete`,
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
@@ -42,7 +44,7 @@ const PositionAPI = {
|
||||
|
||||
batchAvailablePosition(body: BatchType) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/position/available/setting`,
|
||||
url: `${API_PATH}/available/setting`,
|
||||
method: "patch",
|
||||
data: body,
|
||||
});
|
||||
@@ -50,7 +52,7 @@ const PositionAPI = {
|
||||
|
||||
exportPosition(body: PositionPageQuery) {
|
||||
return request<Blob>({
|
||||
url: `/system/position/export`,
|
||||
url: `${API_PATH}/export`,
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: "blob",
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
const API_PATH = "/system/role";
|
||||
|
||||
const RoleAPI = {
|
||||
getRoleList(query?: TablePageQuery) {
|
||||
return request<ApiResponse<PageResult<RoleTable[]>>>({
|
||||
url: `/system/role/list`,
|
||||
url: `${API_PATH}/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -11,14 +13,14 @@ const RoleAPI = {
|
||||
|
||||
getRoleDetail(query: number) {
|
||||
return request<ApiResponse<RoleTable>>({
|
||||
url: `/system/role/detail/${query}`,
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createRole(body: RoleForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/role/create`,
|
||||
url: `${API_PATH}/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -26,7 +28,7 @@ const RoleAPI = {
|
||||
|
||||
updateRole(id: number, body: RoleForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/role/update/${id}`,
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
@@ -34,7 +36,7 @@ const RoleAPI = {
|
||||
|
||||
deleteRole(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/role/delete`,
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
@@ -42,7 +44,7 @@ const RoleAPI = {
|
||||
|
||||
batchAvailableRole(body: BatchType) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/role/available/setting`,
|
||||
url: `${API_PATH}/available/setting`,
|
||||
method: "patch",
|
||||
data: body,
|
||||
});
|
||||
@@ -50,7 +52,7 @@ const RoleAPI = {
|
||||
|
||||
setPermission(body: permissionDataType) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/role/permission/setting`,
|
||||
url: `${API_PATH}/permission/setting`,
|
||||
method: "patch",
|
||||
data: body,
|
||||
});
|
||||
@@ -58,7 +60,7 @@ const RoleAPI = {
|
||||
|
||||
exportRole(body: TablePageQuery) {
|
||||
return request<Blob>({
|
||||
url: `/system/role/export`,
|
||||
url: `${API_PATH}/export`,
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: "blob",
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
import request from "@/utils/request";
|
||||
import { MenuTable, MenuForm } from "@/api/system/menu";
|
||||
|
||||
const API_PATH = "/system/user";
|
||||
|
||||
export const UserAPI = {
|
||||
getCurrentUserInfo() {
|
||||
return request<ApiResponse<UserInfo>>({
|
||||
url: `/system/user/current/info`,
|
||||
url: `${API_PATH}/current/info`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
uploadCurrentUserAvatar(body: any) {
|
||||
return request<ApiResponse<UploadFilePath>>({
|
||||
url: `/system/user/current/avatar/upload`,
|
||||
url: `${API_PATH}/current/avatar/upload`,
|
||||
method: "post",
|
||||
data: body,
|
||||
headers: { "Content-Type": "multipart/form-data" },
|
||||
@@ -20,7 +22,7 @@ export const UserAPI = {
|
||||
|
||||
updateCurrentUserInfo(body: InfoFormState) {
|
||||
return request<ApiResponse<UserInfo>>({
|
||||
url: `/system/user/current/info/update`,
|
||||
url: `${API_PATH}/current/info/update`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
@@ -28,7 +30,7 @@ export const UserAPI = {
|
||||
|
||||
changeCurrentUserPassword(body: PasswordFormState) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/user/current/password/change`,
|
||||
url: `${API_PATH}/current/password/change`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
@@ -36,7 +38,7 @@ export const UserAPI = {
|
||||
|
||||
resetUserPassword(body: ResetPasswordForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/user/reset/password`,
|
||||
url: `${API_PATH}/reset/password`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
@@ -44,7 +46,7 @@ export const UserAPI = {
|
||||
|
||||
registerUser(body: RegisterForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/user/register`,
|
||||
url: `${API_PATH}/register`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -52,7 +54,7 @@ export const UserAPI = {
|
||||
|
||||
forgetPassword(body: ForgetPasswordForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/user/forget/password`,
|
||||
url: `${API_PATH}/forget/password`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -60,7 +62,7 @@ export const UserAPI = {
|
||||
|
||||
getUserList(query: UserPageQuery) {
|
||||
return request<ApiResponse<PageResult<UserInfo[]>>>({
|
||||
url: `/system/user/list`,
|
||||
url: `${API_PATH}/list`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
@@ -68,14 +70,14 @@ export const UserAPI = {
|
||||
|
||||
getUserDetail(query: number) {
|
||||
return request<ApiResponse<UserInfo>>({
|
||||
url: `/system/user/detail/${query}`,
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
createUser(body: UserForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/user/create`,
|
||||
url: `${API_PATH}/create`,
|
||||
method: "post",
|
||||
data: body,
|
||||
});
|
||||
@@ -83,7 +85,7 @@ export const UserAPI = {
|
||||
|
||||
updateUser(id: number, body: UserForm) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/user/update/${id}`,
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: "put",
|
||||
data: body,
|
||||
});
|
||||
@@ -91,7 +93,7 @@ export const UserAPI = {
|
||||
|
||||
deleteUser(body: number[]) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/user/delete`,
|
||||
url: `${API_PATH}/delete`,
|
||||
method: "delete",
|
||||
data: body,
|
||||
});
|
||||
@@ -99,7 +101,7 @@ export const UserAPI = {
|
||||
|
||||
batchAvailableUser(body: BatchType) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/user/available/setting`,
|
||||
url: `${API_PATH}/available/setting`,
|
||||
method: "patch",
|
||||
data: body,
|
||||
});
|
||||
@@ -107,7 +109,7 @@ export const UserAPI = {
|
||||
|
||||
exportUser(body: UserPageQuery) {
|
||||
return request<Blob>({
|
||||
url: `/system/user/export`,
|
||||
url: `${API_PATH}/export`,
|
||||
method: "post",
|
||||
data: body,
|
||||
responseType: "blob",
|
||||
@@ -116,7 +118,7 @@ export const UserAPI = {
|
||||
|
||||
downloadTemplate() {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/user/import/template`,
|
||||
url: `${API_PATH}/import/template`,
|
||||
method: "post",
|
||||
responseType: "blob",
|
||||
});
|
||||
@@ -124,7 +126,7 @@ export const UserAPI = {
|
||||
|
||||
importUser(body: any) {
|
||||
return request<ApiResponse>({
|
||||
url: `/system/user/import/data`,
|
||||
url: `${API_PATH}/import/data`,
|
||||
method: "post",
|
||||
data: body,
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user