22 changed files with 666 additions and 621 deletions
@ -1,30 +1,27 @@
@@ -1,30 +1,27 @@
|
||||
// 引入基础包
|
||||
import { Page, R } from '/@/api/model'; |
||||
import { CommonEntity, Page, R } from '/@/api/model'; |
||||
|
||||
// 定义查询参数
|
||||
export type UserVO = Page & { |
||||
name?: string; |
||||
path?: string; |
||||
}; |
||||
// 查询参数
|
||||
export type UserDto = Page & User; |
||||
|
||||
// 定义用户对象
|
||||
export interface User { |
||||
// 用户对象
|
||||
export interface User extends CommonEntity { |
||||
id: string; |
||||
account: string; |
||||
password?: string; |
||||
name: string; |
||||
realName: string; |
||||
avatar: string; |
||||
userName: string; |
||||
nickName: string; |
||||
password: string; |
||||
deptId: string; |
||||
deptName: string; |
||||
email: string; |
||||
telephone: string; |
||||
birthday: string; |
||||
sex: number; |
||||
roleId: string | number; |
||||
departId: string | number; |
||||
status: number; |
||||
departName: string; |
||||
roleName: string; |
||||
phone: string; |
||||
sex: string; |
||||
avatar: string; |
||||
loginIp: string; |
||||
loginTime: string; |
||||
status: string; |
||||
roleIds: string[]; |
||||
permissions: string[]; |
||||
} |
||||
|
||||
// 根据用户对象生成响应模型
|
||||
export type UserDTO = R<User>; |
||||
// 响应模型
|
||||
export type UserVo = R<User[]>; |
||||
|
@ -1,23 +1,29 @@
@@ -1,23 +1,29 @@
|
||||
import { User, UserVO, UserDTO } from './model/userModel'; |
||||
import { User, UserDto } from './model/userModel'; |
||||
import { defHttp } from '/@/utils/http/axios'; |
||||
|
||||
enum Api { |
||||
Page = '/mate-system/user/page', |
||||
Set = '/mate-system/user/set', |
||||
Del = '/mate-system/user/del', |
||||
SetPassword = '/mate-system/user/set-password', |
||||
list = '/system_proxy/system/user/list', |
||||
add = '/system_proxy/system/user/save', |
||||
get = '/system_proxy/system/user', |
||||
edit = '/system_proxy/system/user/update', |
||||
del = '/system_proxy/system/user/remove', |
||||
updatePwd = '/system_proxy/system/user/updatePwd' |
||||
} |
||||
|
||||
// 菜单树
|
||||
export const page = (params?: UserVO) => defHttp.get<UserDTO>({ url: Api.Page, params }); |
||||
// 查询用户列表
|
||||
export const listUser = (params?: Partial<UserDto>) => defHttp.get({ url: Api.list, params }); |
||||
|
||||
// 保存
|
||||
export const set = (params: User) => defHttp.post<User>({ url: Api.Set, params }); |
||||
// 新增用户
|
||||
export const addUser = (params: Partial<User>) => defHttp.post({ url: Api.add, data: params }); |
||||
|
||||
// 删除
|
||||
export const del = (params: { ids: String }) => |
||||
defHttp.post<boolean>({ url: Api.Del + `?ids=${params.ids}` }); |
||||
// 修改用户
|
||||
export const editUser = (params: Partial<User>) => defHttp.put({ url: Api.edit, data: params }); |
||||
|
||||
// 设置密码
|
||||
export const userSetPassword = (params?: User) => |
||||
defHttp.post<boolean>({ url: Api.SetPassword, params }); |
||||
// 查询用户详细
|
||||
export const getUser = (id: string) => defHttp.get<User>({ url: `${Api.get}/${id}` }); |
||||
|
||||
// 删除用户
|
||||
export const delUser = (id: string) => defHttp.delete({ url: `${Api.del}/${id}` }); |
||||
|
||||
// 更新密码
|
||||
export const updatePwd = (params: Partial<User>) => defHttp.put({ url: Api.updatePwd, params }); |
||||
|
Loading…
Reference in new issue