diff --git a/src/apis/area/index.ts b/src/apis/area/index.ts index 6ce65346..684c0407 100644 --- a/src/apis/area/index.ts +++ b/src/apis/area/index.ts @@ -1,7 +1,9 @@ -import type * as Area from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + /** @desc 获取地区列表 */ export const getAreaList = (params: { type: 'province' | 'city' | 'area', code?: string }) => { - return http.get('/area/list', params) + return http.get('/area/list', params) } diff --git a/src/apis/auth/index.ts b/src/apis/auth/index.ts index a2d6b9c7..61f09c9d 100644 --- a/src/apis/auth/index.ts +++ b/src/apis/auth/index.ts @@ -1,31 +1,33 @@ -import type * as Auth from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/auth' /** @desc 账号登录 */ -export function accountLogin(req: Auth.AccountLoginReq) { - return http.post(`${BASE_URL}/account`, req) +export function accountLogin(req: T.AccountLoginReq) { + return http.post(`${BASE_URL}/account`, req) } /** @desc 手机号登录 */ -export function phoneLogin(req: Auth.PhoneLoginReq) { - return http.post(`${BASE_URL}/phone`, req) +export function phoneLogin(req: T.PhoneLoginReq) { + return http.post(`${BASE_URL}/phone`, req) } /** @desc 邮箱登录 */ -export function emailLogin(req: Auth.EmailLoginReq) { - return http.post(`${BASE_URL}/email`, req) +export function emailLogin(req: T.EmailLoginReq) { + return http.post(`${BASE_URL}/email`, req) } /** @desc 三方账号登录 */ export function socialLogin(source: string, req: any) { - return http.post(`/oauth/${source}`, req) + return http.post(`/oauth/${source}`, req) } /** @desc 三方账号登录授权 */ export function socialAuth(source: string) { - return http.get(`/oauth/${source}`) + return http.get(`/oauth/${source}`) } /** @desc 退出登录 */ @@ -35,10 +37,10 @@ export function logout() { /** @desc 获取用户信息 */ export const getUserInfo = () => { - return http.get(`${BASE_URL}/user/info`) + return http.get(`${BASE_URL}/user/info`) } /** @desc 获取路由信息 */ export const getUserRoute = () => { - return http.get(`${BASE_URL}/route`) + return http.get(`${BASE_URL}/route`) } diff --git a/src/apis/common/captcha.ts b/src/apis/common/captcha.ts index 6900e11c..692650f3 100644 --- a/src/apis/common/captcha.ts +++ b/src/apis/common/captcha.ts @@ -1,11 +1,13 @@ -import type * as Common from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/captcha' /** @desc 获取图片验证码 */ export function getImageCaptcha() { - return http.get(`${BASE_URL}/image`) + return http.get(`${BASE_URL}/image`) } /** @desc 获取短信验证码 */ @@ -20,10 +22,10 @@ export function getEmailCaptcha(query: { email: string }) { /** @desc 获取行为验证码 */ export function getBehaviorCaptcha(req: any) { - return http.get(`${BASE_URL}/behavior`, req) + return http.get(`${BASE_URL}/behavior`, req) } /** @desc 校验行为验证码 */ export function checkBehaviorCaptcha(req: any) { - return http.post(`${BASE_URL}/behavior`, req) + return http.post(`${BASE_URL}/behavior`, req) } diff --git a/src/apis/common/home.ts b/src/apis/common/home.ts index 32d2ebeb..8a51dd37 100644 --- a/src/apis/common/home.ts +++ b/src/apis/common/home.ts @@ -1,14 +1,16 @@ -import type * as Common from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/dashboard' /** @desc 查询访问趋势 */ export function listDashboardAccessTrend(days: number) { - return http.get(`${BASE_URL}/access/trend/${days}`) + return http.get(`${BASE_URL}/access/trend/${days}`) } /** @desc 查询公告列表 */ export function listDashboardNotice() { - return http.get(`${BASE_URL}/notice`) + return http.get(`${BASE_URL}/notice`) } diff --git a/src/apis/monitor/log.ts b/src/apis/monitor/log.ts index 3958d34e..19c45893 100644 --- a/src/apis/monitor/log.ts +++ b/src/apis/monitor/log.ts @@ -1,24 +1,26 @@ -import type * as Monitor from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/system/log' /** @desc 查询日志列表 */ -export function listLog(query: Monitor.LogPageQuery) { - return http.get>(`${BASE_URL}`, query) +export function listLog(query: T.LogPageQuery) { + return http.get>(`${BASE_URL}`, query) } /** @desc 查询日志详情 */ export function getLog(id: string) { - return http.get(`${BASE_URL}/${id}`) + return http.get(`${BASE_URL}/${id}`) } /** @desc 导出登录日志 */ -export function exportLoginLog(query: Monitor.LogQuery) { +export function exportLoginLog(query: T.LogQuery) { return http.download(`${BASE_URL}/export/login`, query) } /** @desc 导出操作日志 */ -export function exportOperationLog(query: Monitor.LogQuery) { +export function exportOperationLog(query: T.LogQuery) { return http.download(`${BASE_URL}/export/operation`, query) } diff --git a/src/apis/monitor/online.ts b/src/apis/monitor/online.ts index 024a3b8d..db036a1b 100644 --- a/src/apis/monitor/online.ts +++ b/src/apis/monitor/online.ts @@ -1,11 +1,13 @@ -import type * as Monitor from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/monitor/online' /** @desc 查询在线用户列表 */ -export function listOnlineUser(query: Monitor.OnlineUserPageQuery) { - return http.get>(`${BASE_URL}`, query) +export function listOnlineUser(query: T.OnlineUserPageQuery) { + return http.get>(`${BASE_URL}`, query) } /** @desc 强退在线用户 */ diff --git a/src/apis/schedule/job.ts b/src/apis/schedule/job.ts index edde488c..ae91e01f 100644 --- a/src/apis/schedule/job.ts +++ b/src/apis/schedule/job.ts @@ -1,6 +1,8 @@ -import type * as Schedule from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/schedule/job' /** @desc 查询任务组列表 */ @@ -9,8 +11,8 @@ export function listGroup() { } /** @desc 查询任务列表 */ -export function listJob(query: Schedule.JobPageQuery) { - return http.get>(`${BASE_URL}`, query) +export function listJob(query: T.JobPageQuery) { + return http.get>(`${BASE_URL}`, query) } /** @desc 新增任务 */ diff --git a/src/apis/schedule/log.ts b/src/apis/schedule/log.ts index acca9eef..f78e2284 100644 --- a/src/apis/schedule/log.ts +++ b/src/apis/schedule/log.ts @@ -1,11 +1,13 @@ -import type * as Schedule from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/schedule/log' /** @desc 查询任务日志列表 */ -export function listJobLog(query: Schedule.JobLogPageQuery) { - return http.get>(`${BASE_URL}`, query) +export function listJobLog(query: T.JobLogPageQuery) { + return http.get>(`${BASE_URL}`, query) } /** @desc 查询任务日志详情 */ @@ -24,11 +26,11 @@ export function retryJob(id: number) { } /** @desc 查询任务实例列表 */ -export function listJobInstance(query: Schedule.JobInstanceQuery) { - return http.get(`${BASE_URL}/instance`, query) +export function listJobInstance(query: T.JobInstanceQuery) { + return http.get(`${BASE_URL}/instance`, query) } /** @desc 查询任务实例日志列表 */ -export function listJobInstanceLog(query: Schedule.JobInstanceLogQuery) { - return http.get(`${BASE_URL}/instance/log`, query) +export function listJobInstanceLog(query: T.JobInstanceLogQuery) { + return http.get(`${BASE_URL}/instance/log`, query) } diff --git a/src/apis/system/dept.ts b/src/apis/system/dept.ts index 78ee7771..807ec273 100644 --- a/src/apis/system/dept.ts +++ b/src/apis/system/dept.ts @@ -1,16 +1,18 @@ -import type * as System from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/system/dept' /** @desc 查询部门列表 */ -export function listDept(query: System.DeptQuery) { - return http.get(`${BASE_URL}/tree`, query) +export function listDept(query: T.DeptQuery) { + return http.get(`${BASE_URL}/tree`, query) } /** @desc 查询部门详情 */ export function getDept(id: string) { - return http.get(`${BASE_URL}/${id}`) + return http.get(`${BASE_URL}/${id}`) } /** @desc 新增部门 */ @@ -29,6 +31,6 @@ export function deleteDept(id: string) { } /** @desc 导出部门 */ -export function exportDept(query: System.DeptQuery) { +export function exportDept(query: T.DeptQuery) { return http.download(`${BASE_URL}/export`, query) } diff --git a/src/apis/system/dict.ts b/src/apis/system/dict.ts index 18121ca0..d0ff2b69 100644 --- a/src/apis/system/dict.ts +++ b/src/apis/system/dict.ts @@ -1,16 +1,18 @@ -import type * as System from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/system/dict' /** @desc 查询字典列表 */ -export function listDict(query: System.DictQuery) { - return http.get(`${BASE_URL}/list`, query) +export function listDict(query: T.DictQuery) { + return http.get(`${BASE_URL}/list`, query) } /** @desc 查询字典详情 */ export function getDict(id: string) { - return http.get(`${BASE_URL}/${id}`) + return http.get(`${BASE_URL}/${id}`) } /** @desc 新增字典 */ @@ -29,13 +31,13 @@ export function deleteDict(id: string) { } /** @desc 查询字典项列表 */ -export function listDictItem(query: System.DictItemPageQuery) { - return http.get>(`${BASE_URL}/item`, query) +export function listDictItem(query: T.DictItemPageQuery) { + return http.get>(`${BASE_URL}/item`, query) } /** @desc 查询字典项详情 */ export function getDictItem(id: string) { - return http.get(`${BASE_URL}/item/${id}`) + return http.get(`${BASE_URL}/item/${id}`) } /** @desc 新增字典项 */ diff --git a/src/apis/system/file.ts b/src/apis/system/file.ts index 2b965974..d34a7639 100644 --- a/src/apis/system/file.ts +++ b/src/apis/system/file.ts @@ -1,11 +1,13 @@ -import type * as System from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/system/file' /** @desc 查询文件列表 */ -export function listFile(query: System.FilePageQuery) { - return http.get>(`${BASE_URL}`, query) +export function listFile(query: T.FilePageQuery) { + return http.get>(`${BASE_URL}`, query) } /** @desc 修改文件 */ @@ -20,5 +22,5 @@ export function deleteFile(ids: string | Array) { /** @desc 查询文件资源统计统计 */ export function getFileStatistics() { - return http.get(`${BASE_URL}/statistics`) + return http.get(`${BASE_URL}/statistics`) } diff --git a/src/apis/system/menu.ts b/src/apis/system/menu.ts index 60399913..29b95401 100644 --- a/src/apis/system/menu.ts +++ b/src/apis/system/menu.ts @@ -1,16 +1,18 @@ -import type * as System from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/system/menu' /** @desc 查询菜单列表 */ -export function listMenu(query: System.MenuQuery) { - return http.get(`${BASE_URL}/tree`, query) +export function listMenu(query: T.MenuQuery) { + return http.get(`${BASE_URL}/tree`, query) } /** @desc 查询菜单详情 */ export function getMenu(id: string) { - return http.get(`${BASE_URL}/${id}`) + return http.get(`${BASE_URL}/${id}`) } /** @desc 新增菜单 */ diff --git a/src/apis/system/message.ts b/src/apis/system/message.ts index 5aa1ce02..0152a3ea 100644 --- a/src/apis/system/message.ts +++ b/src/apis/system/message.ts @@ -1,11 +1,13 @@ -import type * as System from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/system/message' /** @desc 查询消息列表 */ -export function listMessage(query: System.MessagePageQuery) { - return http.get>(`${BASE_URL}`, query) +export function listMessage(query: T.MessagePageQuery) { + return http.get>(`${BASE_URL}`, query) } /** @desc 删除消息 */ diff --git a/src/apis/system/notice.ts b/src/apis/system/notice.ts index daefc524..cb100af7 100644 --- a/src/apis/system/notice.ts +++ b/src/apis/system/notice.ts @@ -1,16 +1,18 @@ -import type * as System from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/system/notice' /** @desc 查询公告列表 */ -export function listNotice(query: System.NoticePageQuery) { - return http.get>(`${BASE_URL}`, query) +export function listNotice(query: T.NoticePageQuery) { + return http.get>(`${BASE_URL}`, query) } /** @desc 查询公告详情 */ export function getNotice(id: string) { - return http.get(`${BASE_URL}/${id}`) + return http.get(`${BASE_URL}/${id}`) } /** @desc 新增公告 */ diff --git a/src/apis/system/option.ts b/src/apis/system/option.ts index 1ae384d3..c63e7fb1 100644 --- a/src/apis/system/option.ts +++ b/src/apis/system/option.ts @@ -1,11 +1,13 @@ -import type * as System from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/system/option' /** @desc 查询参数列表 */ -export function listOption(query: System.OptionQuery) { - return http.get(`${BASE_URL}`, query) +export function listOption(query: T.OptionQuery) { + return http.get(`${BASE_URL}`, query) } /** @desc 修改参数 */ @@ -14,6 +16,6 @@ export function updateOption(data: any) { } /** @desc 重置参数 */ -export function resetOptionValue(query: System.OptionQuery) { +export function resetOptionValue(query: T.OptionQuery) { return http.patch(`${BASE_URL}/value`, query) } diff --git a/src/apis/system/role.ts b/src/apis/system/role.ts index a39dc573..23922bc2 100644 --- a/src/apis/system/role.ts +++ b/src/apis/system/role.ts @@ -1,16 +1,18 @@ -import type * as System from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/system/role' /** @desc 查询角色列表 */ -export function listRole(query: System.RolePageQuery) { - return http.get>(`${BASE_URL}`, query) +export function listRole(query: T.RolePageQuery) { + return http.get>(`${BASE_URL}`, query) } /** @desc 查询角色详情 */ export function getRole(id: string) { - return http.get(`${BASE_URL}/${id}`) + return http.get(`${BASE_URL}/${id}`) } /** @desc 新增角色 */ diff --git a/src/apis/system/storage.ts b/src/apis/system/storage.ts index 75a1b5ef..6336a552 100644 --- a/src/apis/system/storage.ts +++ b/src/apis/system/storage.ts @@ -1,16 +1,18 @@ -import type * as System from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/system/storage' /** @desc 查询存储列表 */ -export function listStorage(query: System.StoragePageQuery) { - return http.get>(`${BASE_URL}`, query) +export function listStorage(query: T.StoragePageQuery) { + return http.get>(`${BASE_URL}`, query) } /** @desc 查询存储详情 */ export function getStorage(id: string) { - return http.get(`${BASE_URL}/${id}`) + return http.get(`${BASE_URL}/${id}`) } /** @desc 新增存储 */ diff --git a/src/apis/system/user.ts b/src/apis/system/user.ts index b7add2df..087ca007 100644 --- a/src/apis/system/user.ts +++ b/src/apis/system/user.ts @@ -1,16 +1,18 @@ -import type * as System from './type' +import type * as T from './type' import http from '@/utils/http' +export type * from './type' + const BASE_URL = '/system/user' /** @desc 查询用户列表 */ -export function listUser(query: System.UserPageQuery) { - return http.get>(`${BASE_URL}`, query) +export function listUser(query: T.UserPageQuery) { + return http.get>(`${BASE_URL}`, query) } /** @desc 查询用户详情 */ export function getUser(id: string) { - return http.get(`${BASE_URL}/${id}`) + return http.get(`${BASE_URL}/${id}`) } /** @desc 新增用户 */ @@ -29,7 +31,7 @@ export function deleteUser(ids: string | Array) { } /** @desc 导出用户 */ -export function exportUser(query: System.UserQuery) { +export function exportUser(query: T.UserQuery) { return http.download(`${BASE_URL}/export`, query) } diff --git a/src/apis/tool/generator.ts b/src/apis/tool/generator.ts index 3d1554c0..54e9b11e 100644 --- a/src/apis/tool/generator.ts +++ b/src/apis/tool/generator.ts @@ -1,32 +1,34 @@ -import type * as Tool from './type' -import type { LabelValueState } from '@/types/global' +import type * as T from './type' import http from '@/utils/http' +import type { LabelValueState } from '@/types/global' + +export type * from './type' const BASE_URL = '/generator' /** @desc 查询代码生成列表 */ -export function listGenerator(query: Tool.TablePageQuery) { - return http.get>(`${BASE_URL}/table`, query) +export function listGenerator(query: T.TablePageQuery) { + return http.get>(`${BASE_URL}/table`, query) } /** @desc 查询字段配置列表 */ export function listFieldConfig(tableName: string, requireSync: boolean) { - return http.get(`${BASE_URL}/field/${tableName}?requireSync=${requireSync}`) + return http.get(`${BASE_URL}/field/${tableName}?requireSync=${requireSync}`) } /** @desc 查询生成配置信息 */ export function getGenConfig(tableName: string) { - return http.get(`${BASE_URL}/config/${tableName}`) + return http.get(`${BASE_URL}/config/${tableName}`) } /** @desc 保存配置信息 */ -export function saveGenConfig(tableName: string, req: Tool.GeneratorConfigResp) { +export function saveGenConfig(tableName: string, req: T.GeneratorConfigResp) { return http.post(`${BASE_URL}/config/${tableName}`, req) } /** @desc 生成预览 */ export function genPreview(tableName: string) { - return http.get(`${BASE_URL}/preview/${tableName}`) + return http.get(`${BASE_URL}/preview/${tableName}`) } /** @desc 生成代码 */ diff --git a/src/views/login/components/account/index.vue b/src/views/login/components/account/index.vue index 6a37bc43..e236d1e6 100644 --- a/src/views/login/components/account/index.vue +++ b/src/views/login/components/account/index.vue @@ -33,7 +33,7 @@