mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-28 15:09:57 +00:00
feat: 重构前端项目结构并优化代码
refactor: 迁移前端资源文件至web目录 feat: 新增多种图标资源 style: 统一代码风格和格式化配置 docs: 更新README和文档说明 chore: 更新依赖和配置文件 fix: 修复部分类型定义和枚举 perf: 优化路由和组件加载逻辑
This commit is contained in:
@@ -0,0 +1,145 @@
|
||||
import request from '@/utils/http';
|
||||
|
||||
const API_PATH = '/system/auth';
|
||||
|
||||
const AuthAPI = {
|
||||
/**
|
||||
* 登录
|
||||
* @param body 登录表单数据
|
||||
* @returns 登录响应
|
||||
*/
|
||||
login(body: LoginFormData) {
|
||||
return request<ApiResponse<LoginResult>>({
|
||||
url: `${API_PATH}/login`,
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 刷新令牌
|
||||
* @param body 刷新令牌请求体
|
||||
* @returns 刷新响应
|
||||
*/
|
||||
refreshToken(body: RefreshToekenBody) {
|
||||
return request<ApiResponse<LoginResult>>({
|
||||
url: `${API_PATH}/token/refresh`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
* @returns 验证码信息
|
||||
*/
|
||||
getCaptcha() {
|
||||
return request<ApiResponse<CaptchaInfo>>({
|
||||
url: `${API_PATH}/captcha/get`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 退出登录
|
||||
* @param body 退出登录操作
|
||||
*/
|
||||
logout(body: LogoutBody) {
|
||||
return request({
|
||||
url: `${API_PATH}/logout`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取免登录用户列表
|
||||
* @returns 免登录用户列表
|
||||
*/
|
||||
getAutoLoginUsers() {
|
||||
return request<ApiResponse<AutoLoginUser[]>>({
|
||||
url: `${API_PATH}/auto-login/users`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取免登录Token
|
||||
* @param userId 用户ID
|
||||
* @returns 免登录Token响应
|
||||
*/
|
||||
getAutoLoginToken(userId: number) {
|
||||
return request<ApiResponse<AutoLoginToken>>({
|
||||
url: `${API_PATH}/auto-login/token`,
|
||||
method: 'post',
|
||||
params: { user_id: userId },
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 免登录
|
||||
* @param token 免登录Token
|
||||
* @returns 登录响应
|
||||
*/
|
||||
autoLogin(token: string) {
|
||||
return request<ApiResponse<LoginResult>>({
|
||||
url: `${API_PATH}/auto-login`,
|
||||
method: 'post',
|
||||
params: { token },
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default AuthAPI;
|
||||
|
||||
/** 登录表单数据 */
|
||||
export interface LoginFormData {
|
||||
username: string;
|
||||
password: string;
|
||||
captcha_key: string;
|
||||
captcha: string;
|
||||
remember: boolean;
|
||||
login_type: string;
|
||||
}
|
||||
|
||||
// 刷新令牌
|
||||
export interface RefreshToekenBody {
|
||||
refresh_token: string;
|
||||
}
|
||||
|
||||
/** 登录响应 */
|
||||
export interface LoginResult {
|
||||
access_token: string;
|
||||
refresh_token: string;
|
||||
token_type: string;
|
||||
expires_in: number;
|
||||
}
|
||||
|
||||
/** 验证码信息 */
|
||||
export interface CaptchaInfo {
|
||||
enable: boolean;
|
||||
key: string;
|
||||
img_base: string;
|
||||
}
|
||||
|
||||
/** 退出登录操作 */
|
||||
export interface LogoutBody {
|
||||
token: string;
|
||||
}
|
||||
|
||||
/** 免登录用户信息 */
|
||||
export interface AutoLoginUser {
|
||||
id: number;
|
||||
username: string;
|
||||
name: string;
|
||||
avatar: string | null;
|
||||
}
|
||||
|
||||
/** 免登录Token响应 */
|
||||
export interface AutoLoginToken {
|
||||
token: string;
|
||||
user: AutoLoginUser;
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
import request from '@/utils/http';
|
||||
|
||||
const API_PATH = '/system/dept';
|
||||
|
||||
const DeptAPI = {
|
||||
/**
|
||||
* 获取部门树
|
||||
* @param query 查询参数
|
||||
* @returns 部门树
|
||||
*/
|
||||
listDept(query?: DeptPageQuery) {
|
||||
return request<ApiResponse<DeptTable[]>>({
|
||||
url: `${API_PATH}/tree`,
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取部门详情
|
||||
* @param query 部门ID
|
||||
* @returns 部门详情
|
||||
*/
|
||||
detailDept(query: number) {
|
||||
return request<ApiResponse<DeptTable>>({
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建部门
|
||||
* @param body 部门信息
|
||||
*/
|
||||
createDept(body: DeptForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/create`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新部门
|
||||
* @param id 部门ID
|
||||
* @param body 部门信息
|
||||
*/
|
||||
updateDept(id: number, body: DeptForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: 'put',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除部门
|
||||
* @param body 部门ID列表
|
||||
*/
|
||||
deleteDept(body: number[]) {
|
||||
return request({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: 'delete',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量设置部门状态
|
||||
* @param body 批量设置部门状态请求体
|
||||
*/
|
||||
batchDept(body: BatchType) {
|
||||
return request({
|
||||
url: `${API_PATH}/available/setting`,
|
||||
method: 'patch',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default DeptAPI;
|
||||
|
||||
export interface DeptPageQuery {
|
||||
name?: string;
|
||||
status?: string;
|
||||
created_time?: string[];
|
||||
}
|
||||
|
||||
export interface DeptTable extends BaseType {
|
||||
name?: string;
|
||||
order?: number;
|
||||
code: string;
|
||||
leader?: string;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
parent_id?: number;
|
||||
parent_name?: string;
|
||||
children?: DeptTable[];
|
||||
}
|
||||
|
||||
export interface DeptForm extends BaseFormType {
|
||||
name?: string;
|
||||
order?: number;
|
||||
code: string;
|
||||
leader?: string;
|
||||
phone?: string;
|
||||
email?: string;
|
||||
parent_id?: number;
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
import request from '@/utils/http';
|
||||
|
||||
const API_PATH = '/system/dict';
|
||||
|
||||
const DictAPI = {
|
||||
/**
|
||||
* 获取字典类型列表
|
||||
* @param query 查询参数
|
||||
* @returns 字典类型列表
|
||||
*/
|
||||
listDictType(query: DictPageQuery) {
|
||||
return request<PageResult<DictTable[]>>({
|
||||
url: `${API_PATH}/type/list`,
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取字典类型选项选择列表
|
||||
* @returns 字典类型选项选择列表
|
||||
*/
|
||||
optionDictType() {
|
||||
return request({
|
||||
url: `${API_PATH}/type/optionselect`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取字典类型详情
|
||||
* @param query 字典类型ID
|
||||
* @returns 字典类型详情
|
||||
*/
|
||||
detailDictType(query: number) {
|
||||
return request<ApiResponse<DictTable>>({
|
||||
url: `${API_PATH}/type/detail/${query}`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建字典类型
|
||||
* @param body 字典类型信息
|
||||
*/
|
||||
createDictType(body: DictForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/type/create`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新字典类型
|
||||
* @param id 字典类型ID
|
||||
* @param body 字典类型信息
|
||||
*/
|
||||
updateDictType(id: number, body: DictForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/type/update/${id}`,
|
||||
method: 'put',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除字典类型
|
||||
* @param body 字典类型ID列表
|
||||
*/
|
||||
deleteDictType(body: number[]) {
|
||||
return request({
|
||||
url: `${API_PATH}/type/delete`,
|
||||
method: 'delete',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量设置字典类型状态
|
||||
* @param body 批量设置字典类型状态请求体
|
||||
*/
|
||||
batchDictType(body: BatchType) {
|
||||
return request({
|
||||
url: `${API_PATH}/type/available/setting`,
|
||||
method: 'patch',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 导出字典类型
|
||||
* @param body 查询参数
|
||||
* @returns 字典类型导出文件
|
||||
*/
|
||||
exportDictType(body: DictPageQuery) {
|
||||
return request<ApiResponse<Blob>>({
|
||||
url: `${API_PATH}/type/export`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
responseType: 'blob',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取字典数据列表
|
||||
* @param query 查询参数
|
||||
* @returns 字典数据列表
|
||||
*/
|
||||
listDictData(query: DictDataPageQuery) {
|
||||
return request<PageResult<DictDataTable[]>>({
|
||||
url: `${API_PATH}/data/list`,
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取字典数据详情
|
||||
* @param query 字典数据ID
|
||||
* @returns 字典数据详情
|
||||
*/
|
||||
detailDictData(query: number) {
|
||||
return request<ApiResponse<DictDataTable>>({
|
||||
url: `${API_PATH}/data/detail/${query}`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建字典数据
|
||||
* @param body 字典数据信息
|
||||
*/
|
||||
createDictData(body: DictDataForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/data/create`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新字典数据
|
||||
* @param id 字典数据ID
|
||||
* @param body 字典数据信息
|
||||
*/
|
||||
updateDictData(id: number, body: DictDataForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/data/update/${id}`,
|
||||
method: 'put',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除字典数据
|
||||
* @param body 字典数据ID列表
|
||||
*/
|
||||
deleteDictData(body: number[]) {
|
||||
return request({
|
||||
url: `${API_PATH}/data/delete`,
|
||||
method: 'delete',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量设置字典数据状态
|
||||
* @param body 批量设置字典数据状态请求体
|
||||
*/
|
||||
batchDictData(body: BatchType) {
|
||||
return request({
|
||||
url: `${API_PATH}/data/available/setting`,
|
||||
method: 'patch',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 导出字典数据
|
||||
* @param body 查询参数
|
||||
* @returns 字典数据导出文件
|
||||
*/
|
||||
exportDictData(body: DictDataPageQuery) {
|
||||
return request<ApiResponse<Blob>>({
|
||||
url: `${API_PATH}/data/export`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
responseType: 'blob',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取初始化字典数据
|
||||
* @param dict_type 字典类型
|
||||
* @returns 初始化字典数据
|
||||
*/
|
||||
getInitDict(dict_type: string) {
|
||||
return request({
|
||||
url: `${API_PATH}/data/info/${dict_type}`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default DictAPI;
|
||||
|
||||
export interface DictPageQuery extends PageQuery {
|
||||
dict_name?: string;
|
||||
dict_type?: string;
|
||||
status?: string;
|
||||
created_time?: string[];
|
||||
updated_time?: string[];
|
||||
}
|
||||
|
||||
export interface DictDataPageQuery extends PageQuery {
|
||||
dict_label?: string;
|
||||
dict_type?: string;
|
||||
dict_type_id?: number;
|
||||
status?: string;
|
||||
created_time?: string[];
|
||||
updated_time?: string[];
|
||||
}
|
||||
|
||||
export interface DictTable extends BaseType {
|
||||
dict_name?: string;
|
||||
dict_type?: string;
|
||||
}
|
||||
|
||||
export interface DictForm extends BaseFormType {
|
||||
dict_name?: string;
|
||||
dict_type?: string;
|
||||
}
|
||||
|
||||
export interface DictDataTable extends BaseType {
|
||||
dict_sort?: number;
|
||||
dict_label?: string;
|
||||
dict_value?: string;
|
||||
dict_type_id?: number;
|
||||
dict_type?: string;
|
||||
css_class?: string;
|
||||
list_class?: string;
|
||||
is_default?: boolean;
|
||||
}
|
||||
|
||||
export interface DictDataForm extends BaseFormType {
|
||||
dict_sort?: number;
|
||||
dict_label?: string;
|
||||
dict_value?: string;
|
||||
dict_type_id?: number;
|
||||
dict_type?: string;
|
||||
css_class?: string;
|
||||
list_class?: string;
|
||||
is_default?: boolean;
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import request from '@/utils/http';
|
||||
|
||||
const API_PATH = '/system/log';
|
||||
|
||||
const LogAPI = {
|
||||
/**
|
||||
* 获取日志列表
|
||||
* @param query 查询参数
|
||||
* @returns 日志列表
|
||||
*/
|
||||
listLog(query: LogPageQuery) {
|
||||
return request<PageResult<LogTable[]>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取日志详情
|
||||
* @param query 日志ID
|
||||
* @returns 日志详情
|
||||
*/
|
||||
detailLog(query: number) {
|
||||
return request<ApiResponse<LogTable>>({
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除日志
|
||||
* @param body 日志ID列表
|
||||
*/
|
||||
deleteLog(body: number[]) {
|
||||
return request({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: 'delete',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 导出日志
|
||||
* @param body 查询参数
|
||||
* @returns 日志导出文件
|
||||
*/
|
||||
exportLog(body: LogPageQuery) {
|
||||
return request<ApiResponse<Blob>>({
|
||||
url: `${API_PATH}/export`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
responseType: 'blob',
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default LogAPI;
|
||||
|
||||
export interface LogPageQuery extends PageQuery {
|
||||
type?: number;
|
||||
request_path?: string;
|
||||
creator_name?: string;
|
||||
created_time?: string[];
|
||||
updated_time?: string[];
|
||||
created_id?: number;
|
||||
updated_id?: number;
|
||||
}
|
||||
|
||||
export interface LogTable extends BaseType {
|
||||
type?: number; // 1 登录日志 2 操作日志
|
||||
request_path?: string;
|
||||
request_method?: string;
|
||||
request_ip?: string;
|
||||
login_location?: string;
|
||||
request_browser?: string;
|
||||
request_os?: string;
|
||||
response_code?: number;
|
||||
request_payload?: string;
|
||||
response_json?: string;
|
||||
process_time?: string;
|
||||
created_by?: CommonType;
|
||||
updated_by?: CommonType;
|
||||
deleted_by?: CommonType;
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
import request from '@/utils/http';
|
||||
|
||||
const API_PATH = '/system/menu';
|
||||
|
||||
const MenuAPI = {
|
||||
/**
|
||||
* 获取菜单树
|
||||
* @param query 查询参数
|
||||
* @returns 菜单树
|
||||
*/
|
||||
listMenu(query?: MenuPageQuery) {
|
||||
return request<ApiResponse<MenuTable[]>>({
|
||||
url: `${API_PATH}/tree`,
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取菜单详情
|
||||
* @param query 菜单ID
|
||||
* @returns 菜单详情
|
||||
*/
|
||||
detailMenu(query: number) {
|
||||
return request<ApiResponse<MenuTable>>({
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建菜单
|
||||
* @param body 菜单信息
|
||||
*/
|
||||
createMenu(body: MenuForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/create`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新菜单
|
||||
* @param id 菜单ID
|
||||
* @param body 菜单信息
|
||||
*/
|
||||
updateMenu(id: number, body: MenuForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: 'put',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除菜单
|
||||
* @param body 菜单ID列表
|
||||
*/
|
||||
deleteMenu(body: number[]) {
|
||||
return request({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: 'delete',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量设置菜单状态
|
||||
* @param body 批量操作参数
|
||||
*/
|
||||
batchMenu(body: BatchType) {
|
||||
return request({
|
||||
url: `${API_PATH}/available/setting`,
|
||||
method: 'patch',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default MenuAPI;
|
||||
|
||||
export interface MenuPageQuery {
|
||||
name?: string;
|
||||
status?: string;
|
||||
created_time?: string[];
|
||||
updated_time?: string[];
|
||||
}
|
||||
|
||||
export interface MenuTable extends BaseType {
|
||||
name?: string;
|
||||
type?: number;
|
||||
icon?: string;
|
||||
order?: number;
|
||||
permission?: string;
|
||||
route_name?: string;
|
||||
route_path?: string;
|
||||
component_path?: string;
|
||||
redirect?: string;
|
||||
parent_id?: number;
|
||||
parent_name?: string;
|
||||
keep_alive?: boolean;
|
||||
hidden?: boolean;
|
||||
always_show?: boolean;
|
||||
title?: string;
|
||||
params?: { key: string; value: string }[];
|
||||
affix?: boolean;
|
||||
children?: MenuTable[];
|
||||
}
|
||||
|
||||
export interface MenuForm extends BaseFormType {
|
||||
name?: string;
|
||||
type?: number;
|
||||
icon?: string;
|
||||
order?: number;
|
||||
permission?: string;
|
||||
route_name?: string;
|
||||
route_path?: string;
|
||||
component_path?: string;
|
||||
redirect?: string;
|
||||
parent_id?: number;
|
||||
keep_alive?: boolean;
|
||||
hidden?: boolean;
|
||||
always_show?: boolean;
|
||||
title?: string;
|
||||
params?: KeyValue[];
|
||||
affix?: boolean;
|
||||
}
|
||||
|
||||
export interface KeyValue {
|
||||
key: string;
|
||||
value: string;
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
import request from '@/utils/http';
|
||||
|
||||
const API_PATH = '/system/notice';
|
||||
|
||||
const NoticeAPI = {
|
||||
/**
|
||||
* 获取通知列表
|
||||
* @param query 查询参数
|
||||
* @returns 通知列表
|
||||
*/
|
||||
listNotice(query: NoticePageQuery) {
|
||||
return request<PageResult<NoticeTable[]>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取可用通知列表
|
||||
* @returns 通知列表
|
||||
*/
|
||||
listNoticeAvailable() {
|
||||
return request<PageResult<NoticeTable[]>>({
|
||||
url: `${API_PATH}/available`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取通知详情
|
||||
* @param query 通知ID
|
||||
* @returns 通知详情
|
||||
*/
|
||||
detailNotice(query: number) {
|
||||
return request<ApiResponse<NoticeTable>>({
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建通知
|
||||
* @param body 通知信息
|
||||
*/
|
||||
createNotice(body: NoticeForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/create`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新通知
|
||||
* @param id 通知ID
|
||||
* @param body 通知信息
|
||||
*/
|
||||
updateNotice(id: number, body: NoticeForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: 'put',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除通知
|
||||
* @param body 通知ID列表
|
||||
*/
|
||||
deleteNotice(body: number[]) {
|
||||
return request({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: 'delete',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量设置通知状态
|
||||
* @param body 批量操作参数
|
||||
*/
|
||||
batchNotice(body: BatchType) {
|
||||
return request({
|
||||
url: `${API_PATH}/available/setting`,
|
||||
method: 'patch',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 导出通知
|
||||
* @param body 查询参数
|
||||
* @returns 通知导出文件
|
||||
*/
|
||||
exportNotice(body: NoticePageQuery) {
|
||||
return request<ApiResponse<Blob>>({
|
||||
url: `${API_PATH}/export`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
responseType: 'blob',
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default NoticeAPI;
|
||||
|
||||
export interface NoticePageQuery extends PageQuery {
|
||||
notice_title?: string;
|
||||
notice_type?: string;
|
||||
status?: string;
|
||||
created_time?: string[];
|
||||
updated_time?: string[];
|
||||
created_id?: number;
|
||||
updated_id?: number;
|
||||
}
|
||||
|
||||
export interface NoticeTable extends BaseType {
|
||||
notice_title?: string;
|
||||
notice_type?: string;
|
||||
notice_content?: string;
|
||||
created_by?: CommonType;
|
||||
updated_by?: CommonType;
|
||||
deleted_by?: CommonType;
|
||||
}
|
||||
|
||||
export interface NoticeForm extends BaseFormType {
|
||||
notice_title?: string;
|
||||
notice_type?: string;
|
||||
notice_content?: string;
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
import request from '@/utils/http';
|
||||
|
||||
const API_PATH = '/system/param';
|
||||
|
||||
const ParamsAPI = {
|
||||
/**
|
||||
* 上传文件
|
||||
* @param body 文件数据
|
||||
* @returns 上传后的文件路径
|
||||
*/
|
||||
uploadFile(body: any) {
|
||||
return request<ApiResponse<UploadFilePath>>({
|
||||
url: `${API_PATH}/upload`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取初始化配置
|
||||
* @returns 初始化配置列表
|
||||
*/
|
||||
getInitConfig() {
|
||||
return request<ApiResponse<ConfigTable[]>>({
|
||||
url: `${API_PATH}/info`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取参数列表
|
||||
* @param query 查询参数
|
||||
* @returns 参数列表
|
||||
*/
|
||||
listParams(query: ConfigPageQuery) {
|
||||
return request<PageResult<ConfigTable[]>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取参数详情
|
||||
* @param query 参数ID
|
||||
* @returns 参数详情
|
||||
*/
|
||||
detailParams(query: number) {
|
||||
return request<ApiResponse<ConfigTable>>({
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建参数
|
||||
* @param body 参数信息
|
||||
*/
|
||||
createParams(body: ConfigForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/create`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新参数
|
||||
* @param id 参数ID
|
||||
* @param body 参数信息
|
||||
*/
|
||||
updateParams(id: number, body: ConfigForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: 'put',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除参数
|
||||
* @param body 参数ID列表
|
||||
*/
|
||||
deleteParams(body: number[]) {
|
||||
return request({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: 'delete',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 导出参数
|
||||
* @param body 查询参数
|
||||
* @returns 导出的参数文件
|
||||
*/
|
||||
exportParams(body: ConfigPageQuery) {
|
||||
return request<ApiResponse<Blob>>({
|
||||
url: `${API_PATH}/export`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
responseType: 'blob',
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default ParamsAPI;
|
||||
|
||||
export interface ConfigPageQuery extends PageQuery {
|
||||
config_name?: string;
|
||||
config_key?: string;
|
||||
config_type?: boolean;
|
||||
created_time?: string[];
|
||||
updated_time?: string[];
|
||||
}
|
||||
|
||||
export interface ConfigTable extends BaseType {
|
||||
config_name?: string;
|
||||
config_key?: string;
|
||||
config_value?: string;
|
||||
config_type?: boolean;
|
||||
}
|
||||
|
||||
export interface ConfigForm extends BaseFormType {
|
||||
config_name?: string;
|
||||
config_key?: string;
|
||||
config_value?: string;
|
||||
config_type?: boolean;
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
import request from '@/utils/http';
|
||||
|
||||
const API_PATH = '/system/position';
|
||||
|
||||
const PositionAPI = {
|
||||
/**
|
||||
* 获取岗位列表
|
||||
* @param query 查询参数
|
||||
* @returns 岗位列表
|
||||
*/
|
||||
listPosition(query?: PositionPageQuery) {
|
||||
return request<PageResult<PositionTable[]>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取岗位详情
|
||||
* @param query 岗位ID
|
||||
* @returns 岗位详情
|
||||
*/
|
||||
detailPosition(query: number) {
|
||||
return request<ApiResponse<PositionTable>>({
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建岗位
|
||||
* @param body 岗位信息
|
||||
*/
|
||||
createPosition(body: PositionForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/create`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新岗位
|
||||
* @param id 岗位ID
|
||||
* @param body 岗位信息
|
||||
*/
|
||||
updatePosition(id: number, body: PositionForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: 'put',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除岗位
|
||||
* @param body 岗位ID列表
|
||||
*/
|
||||
deletePosition(body: number[]) {
|
||||
return request({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: 'delete',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量设置岗位状态
|
||||
* @param body 批量操作参数
|
||||
*/
|
||||
batchPosition(body: BatchType) {
|
||||
return request({
|
||||
url: `${API_PATH}/available/setting`,
|
||||
method: 'patch',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 导出岗位
|
||||
* @param body 查询参数
|
||||
* @returns 导出的岗位文件
|
||||
*/
|
||||
exportPosition(body: PositionPageQuery) {
|
||||
return request<ApiResponse<Blob>>({
|
||||
url: `${API_PATH}/export`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
responseType: 'blob',
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default PositionAPI;
|
||||
|
||||
export interface PositionPageQuery extends PageQuery {
|
||||
name?: string;
|
||||
status?: string;
|
||||
created_id?: number;
|
||||
created_time?: string[];
|
||||
updated_time?: string[];
|
||||
}
|
||||
|
||||
export interface PositionTable extends BaseType {
|
||||
name?: string;
|
||||
order?: number;
|
||||
created_by?: CommonType;
|
||||
updated_by?: CommonType;
|
||||
deleted_by?: CommonType;
|
||||
}
|
||||
|
||||
export interface PositionForm extends BaseFormType {
|
||||
name?: string;
|
||||
order?: number;
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
import request from '@/utils/http';
|
||||
|
||||
const API_PATH = '/system/role';
|
||||
|
||||
const RoleAPI = {
|
||||
/**
|
||||
* 获取角色列表
|
||||
* @param query 查询参数
|
||||
* @returns 角色列表
|
||||
*/
|
||||
listRole(query?: TablePageQuery) {
|
||||
return request<PageResult<RoleTable[]>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取角色详情
|
||||
* @param query 角色ID
|
||||
* @returns 角色详情
|
||||
*/
|
||||
detailRole(query: number) {
|
||||
return request<ApiResponse<RoleTable>>({
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建角色
|
||||
* @param body 角色信息
|
||||
*/
|
||||
createRole(body: RoleForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/create`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新角色
|
||||
* @param id 角色ID
|
||||
* @param body 角色信息
|
||||
*/
|
||||
updateRole(id: number, body: RoleForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: 'put',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除角色
|
||||
* @param body 角色ID列表
|
||||
*/
|
||||
deleteRole(body: number[]) {
|
||||
return request({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: 'delete',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量设置角色状态
|
||||
* @param body 批量操作参数
|
||||
*/
|
||||
batchRole(body: BatchType) {
|
||||
return request({
|
||||
url: `${API_PATH}/available/setting`,
|
||||
method: 'patch',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量设置角色权限
|
||||
* @param body 批量操作参数
|
||||
*/
|
||||
setPermission(body: permissionDataType) {
|
||||
return request({
|
||||
url: `${API_PATH}/permission/setting`,
|
||||
method: 'patch',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 导出角色列表
|
||||
* @param body 查询参数
|
||||
* @returns 导出的文件
|
||||
*/
|
||||
exportRole(body: TablePageQuery) {
|
||||
return request<ApiResponse<Blob>>({
|
||||
url: `${API_PATH}/export`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
responseType: 'blob',
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default RoleAPI;
|
||||
|
||||
export interface TablePageQuery extends PageQuery {
|
||||
name?: string;
|
||||
status?: string;
|
||||
created_time?: string[];
|
||||
updated_time?: string[];
|
||||
}
|
||||
|
||||
export interface RoleTable extends BaseType {
|
||||
id: number;
|
||||
name: string;
|
||||
order?: number;
|
||||
code: string;
|
||||
data_scope?: number;
|
||||
menus?: permissionMenuType[];
|
||||
depts?: permissionDeptType[];
|
||||
}
|
||||
|
||||
export interface RoleForm extends BaseFormType {
|
||||
name?: string;
|
||||
order?: number;
|
||||
code: string;
|
||||
}
|
||||
|
||||
export interface permissionDataType {
|
||||
data_scope: number;
|
||||
role_ids: RoleTable['id'][];
|
||||
menu_ids: permissionMenuType['id'][];
|
||||
dept_ids: permissionDeptType['id'][];
|
||||
}
|
||||
|
||||
export interface permissionDeptType {
|
||||
id: number;
|
||||
name: string;
|
||||
parent_id: number;
|
||||
children: permissionDeptType[];
|
||||
}
|
||||
|
||||
export interface permissionMenuType {
|
||||
id: number;
|
||||
name: string;
|
||||
type: number;
|
||||
permission: string;
|
||||
parent_id?: number;
|
||||
status: string;
|
||||
description?: string;
|
||||
children?: permissionMenuType[];
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
import request from '@/utils/http';
|
||||
|
||||
const API_PATH = '/system/tenant';
|
||||
|
||||
const TenantAPI = {
|
||||
/**
|
||||
* 获取租户列表
|
||||
* @param query 查询参数
|
||||
* @returns 租户列表
|
||||
*/
|
||||
listTenant(query?: TenantPageQuery) {
|
||||
return request<PageResult<TenantTable[]>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取租户详情
|
||||
* @param id 租户ID
|
||||
* @returns 租户详情
|
||||
*/
|
||||
detailTenant(id: number) {
|
||||
return request<ApiResponse<TenantTable>>({
|
||||
url: `${API_PATH}/detail/${id}`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建租户
|
||||
* @param body 租户信息
|
||||
*/
|
||||
createTenant(body: TenantCreateForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/create`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新租户
|
||||
* @param id 租户ID
|
||||
* @param body 租户信息
|
||||
*/
|
||||
updateTenant(id: number, body: TenantUpdateForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: 'put',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除租户
|
||||
* @param body 租户ID列表
|
||||
*/
|
||||
deleteTenant(body: number[]) {
|
||||
return request({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: 'delete',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量设置租户状态
|
||||
* @param body 批量操作参数
|
||||
*/
|
||||
batchTenant(body: BatchType) {
|
||||
return request({
|
||||
url: `${API_PATH}/available/setting`,
|
||||
method: 'patch',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default TenantAPI;
|
||||
|
||||
export interface TenantPageQuery extends PageQuery {
|
||||
name?: string;
|
||||
code?: string;
|
||||
status?: string;
|
||||
created_time?: string[];
|
||||
}
|
||||
|
||||
export interface TenantTable extends BaseType {
|
||||
name: string;
|
||||
code: string;
|
||||
start_time?: string;
|
||||
end_time?: string;
|
||||
}
|
||||
|
||||
export interface TenantForm {
|
||||
id?: number;
|
||||
name?: string;
|
||||
code?: string;
|
||||
status?: string;
|
||||
description?: string;
|
||||
start_time?: string;
|
||||
end_time?: string;
|
||||
}
|
||||
|
||||
export interface TenantCreateForm {
|
||||
name: string;
|
||||
code: string;
|
||||
status?: string;
|
||||
description?: string;
|
||||
start_time?: string;
|
||||
end_time?: string;
|
||||
}
|
||||
|
||||
export interface TenantUpdateForm {
|
||||
name?: string;
|
||||
status?: string;
|
||||
description?: string;
|
||||
start_time?: string;
|
||||
end_time?: string;
|
||||
}
|
||||
|
||||
export interface BatchType {
|
||||
ids: number[];
|
||||
status: string;
|
||||
}
|
||||
@@ -0,0 +1,346 @@
|
||||
import request from '@/utils/http';
|
||||
import { MenuTable, MenuForm } from '@/api/module_system/menu';
|
||||
|
||||
const API_PATH = '/system/user';
|
||||
|
||||
export const UserAPI = {
|
||||
/**
|
||||
* 获取当前用户信息
|
||||
* @returns 当前用户信息
|
||||
*/
|
||||
getCurrentUserInfo() {
|
||||
return request<ApiResponse<UserInfo>>({
|
||||
url: `${API_PATH}/current/info`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 上传当前用户头像
|
||||
* @param body 头像文件
|
||||
* @returns 上传后的文件路径
|
||||
*/
|
||||
uploadCurrentUserAvatar(body: any) {
|
||||
return request<ApiResponse<UploadFilePath>>({
|
||||
url: `${API_PATH}/current/avatar/upload`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新当前用户信息
|
||||
* @param body 用户信息
|
||||
* @returns 更新后的用户信息
|
||||
*/
|
||||
updateCurrentUserInfo(body: InfoFormState) {
|
||||
return request<ApiResponse<UserInfo>>({
|
||||
url: `${API_PATH}/current/info/update`,
|
||||
method: 'put',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新当前用户密码
|
||||
* @param body 密码信息
|
||||
* @returns 更新后的用户信息
|
||||
*/
|
||||
changeCurrentUserPassword(body: PasswordFormState) {
|
||||
return request({
|
||||
url: `${API_PATH}/current/password/change`,
|
||||
method: 'put',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 重置用户密码
|
||||
* @param body 重置密码信息
|
||||
* @returns 重置密码后的用户信息
|
||||
*/
|
||||
resetUserPassword(body: ResetPasswordForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/reset/password`,
|
||||
method: 'put',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 注册用户
|
||||
* @param body 注册信息
|
||||
* @returns 注册后的用户信息
|
||||
*/
|
||||
registerUser(body: RegisterForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/register`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 忘记密码
|
||||
* @param body 忘记密码信息
|
||||
* @returns 忘记密码后的用户信息
|
||||
*/
|
||||
forgetPassword(body: ForgetPasswordForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/forget/password`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
* @param query 查询参数
|
||||
* @returns 用户列表
|
||||
*/
|
||||
listUser(query: UserPageQuery) {
|
||||
return request<PageResult<UserInfo[]>>({
|
||||
url: `${API_PATH}/list`,
|
||||
method: 'get',
|
||||
params: query,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取用户详情
|
||||
* @param id 用户ID
|
||||
* @returns 用户详情
|
||||
*/
|
||||
detailUser(query: number) {
|
||||
return request<ApiResponse<UserInfo>>({
|
||||
url: `${API_PATH}/detail/${query}`,
|
||||
method: 'get',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建用户
|
||||
* @param body 用户信息
|
||||
* @returns 创建后的用户信息
|
||||
*/
|
||||
createUser(body: UserForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/create`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新用户
|
||||
* @param id 用户ID
|
||||
* @param body 用户信息
|
||||
* @returns 更新后的用户信息
|
||||
*/
|
||||
updateUser(id: number, body: UserForm) {
|
||||
return request({
|
||||
url: `${API_PATH}/update/${id}`,
|
||||
method: 'put',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
* @param body 用户ID列表
|
||||
*/
|
||||
deleteUser(body: number[]) {
|
||||
return request({
|
||||
url: `${API_PATH}/delete`,
|
||||
method: 'delete',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量设置用户状态
|
||||
* @param body 批量设置用户状态信息
|
||||
* @returns 批量设置用户状态后的用户列表
|
||||
*/
|
||||
batchUser(body: BatchType) {
|
||||
return request({
|
||||
url: `${API_PATH}/available/setting`,
|
||||
method: 'patch',
|
||||
data: body,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 导出用户
|
||||
* @param body 查询参数
|
||||
* @returns 导出的用户文件
|
||||
*/
|
||||
exportUser(body: UserPageQuery) {
|
||||
return request<ApiResponse<Blob>>({
|
||||
url: `${API_PATH}/export`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
responseType: 'blob',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 下载用户导入模板
|
||||
* @returns 导入模板文件
|
||||
*/
|
||||
downloadTemplateUser() {
|
||||
return request({
|
||||
url: `${API_PATH}/import/template`,
|
||||
method: 'post',
|
||||
responseType: 'blob',
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 导入用户数据
|
||||
* @param body 导入数据文件
|
||||
* @returns 导入后的用户列表
|
||||
*/
|
||||
importUser(body: any) {
|
||||
return request<ApiResponse<UserInfo[]>>({
|
||||
url: `${API_PATH}/import/data`,
|
||||
method: 'post',
|
||||
data: body,
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default UserAPI;
|
||||
|
||||
export interface ForgetPasswordForm {
|
||||
username: string;
|
||||
new_password: string;
|
||||
mobile?: string;
|
||||
confirmPassword: string;
|
||||
}
|
||||
|
||||
export interface RegisterForm {
|
||||
username: string;
|
||||
password: string;
|
||||
confirmPassword: string;
|
||||
}
|
||||
|
||||
export interface UserPageQuery extends PageQuery {
|
||||
username?: string;
|
||||
name?: string;
|
||||
mobile?: string;
|
||||
email?: string;
|
||||
dept_id?: number;
|
||||
status?: string;
|
||||
created_time?: string[];
|
||||
created_id?: number;
|
||||
updated_id?: number;
|
||||
}
|
||||
|
||||
export interface searchSelectDataType {
|
||||
name?: string;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
export interface UserInfo extends BaseType {
|
||||
username?: string;
|
||||
name?: string;
|
||||
avatar?: string;
|
||||
email?: string;
|
||||
mobile?: string;
|
||||
gender?: string;
|
||||
password?: string;
|
||||
menus?: MenuTable[];
|
||||
dept?: deptTreeType;
|
||||
dept_id?: deptTreeType['id'];
|
||||
dept_name?: deptTreeType['name'];
|
||||
roles?: roleSelectorType[];
|
||||
role_names?: roleSelectorType['name'][];
|
||||
role_ids?: roleSelectorType['id'][];
|
||||
positions?: positionSelectorType[];
|
||||
position_names?: positionSelectorType['name'][];
|
||||
position_ids?: positionSelectorType['id'][];
|
||||
is_superuser?: boolean;
|
||||
last_login?: string;
|
||||
created_by?: CommonType;
|
||||
updated_by?: CommonType;
|
||||
deleted_by?: CommonType;
|
||||
}
|
||||
|
||||
export interface deptTreeType {
|
||||
id?: number;
|
||||
name?: string;
|
||||
parent_id?: number;
|
||||
children?: deptTreeType[];
|
||||
}
|
||||
|
||||
export interface roleSelectorType {
|
||||
id?: number;
|
||||
name?: string;
|
||||
code?: string;
|
||||
status?: string;
|
||||
description?: string;
|
||||
menus?: MenuForm[];
|
||||
}
|
||||
|
||||
export interface positionSelectorType {
|
||||
id?: number;
|
||||
name?: string;
|
||||
status?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
export interface InfoFormState {
|
||||
id?: number;
|
||||
name?: string;
|
||||
gender?: number;
|
||||
mobile?: string;
|
||||
email?: string;
|
||||
username?: string;
|
||||
dept_name?: string;
|
||||
dept?: deptTreeType;
|
||||
positions?: positionSelectorType[];
|
||||
roles?: roleSelectorType[];
|
||||
avatar?: string;
|
||||
created_time?: string;
|
||||
updated_time?: string;
|
||||
}
|
||||
|
||||
export interface PasswordFormState {
|
||||
old_password: string;
|
||||
new_password: string;
|
||||
confirm_password: string;
|
||||
}
|
||||
|
||||
export interface ResetPasswordForm {
|
||||
id: number;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface UserForm extends BaseFormType {
|
||||
username?: string;
|
||||
name?: string;
|
||||
dept_id?: number;
|
||||
dept_name?: string;
|
||||
role_ids?: number[];
|
||||
role_names?: string[];
|
||||
position_ids?: number[];
|
||||
position_names?: string[];
|
||||
password?: string;
|
||||
gender?: number;
|
||||
email?: string;
|
||||
mobile?: string;
|
||||
is_superuser?: boolean;
|
||||
}
|
||||
|
||||
export interface CurrentUserFormState {
|
||||
name?: string;
|
||||
gender?: number;
|
||||
mobile?: string;
|
||||
email?: string;
|
||||
avatar?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user