提交 | 用户 | 时间
|
314507
|
1 |
import request from '@/config/axios' |
H |
2 |
|
|
3 |
export interface UserVO { |
|
4 |
id: number |
|
5 |
username: string |
|
6 |
nickname: string |
|
7 |
deptId: number |
|
8 |
postIds: string[] |
|
9 |
email: string |
|
10 |
mobile: string |
|
11 |
sex: number |
|
12 |
avatar: string |
|
13 |
loginIp: string |
|
14 |
status: number |
|
15 |
remark: string |
|
16 |
loginDate: Date |
|
17 |
createTime: Date |
|
18 |
} |
|
19 |
|
|
20 |
// 查询用户管理列表 |
|
21 |
export const getUserPage = (params: PageParam) => { |
|
22 |
return request.get({ url: '/system/user/page', params }) |
|
23 |
} |
|
24 |
|
|
25 |
// 查询所有用户列表 |
|
26 |
export const getAllUser = () => { |
|
27 |
return request.get({ url: '/system/user/all' }) |
|
28 |
} |
|
29 |
|
|
30 |
// 查询用户详情 |
|
31 |
export const getUser = (id: number) => { |
|
32 |
return request.get({ url: '/system/user/get?id=' + id }) |
|
33 |
} |
|
34 |
|
|
35 |
// 新增用户 |
|
36 |
export const createUser = (data: UserVO) => { |
|
37 |
return request.post({ url: '/system/user/create', data }) |
|
38 |
} |
|
39 |
|
|
40 |
// 修改用户 |
|
41 |
export const updateUser = (data: UserVO) => { |
|
42 |
return request.put({ url: '/system/user/update', data }) |
|
43 |
} |
|
44 |
|
|
45 |
// 删除用户 |
|
46 |
export const deleteUser = (id: number) => { |
|
47 |
return request.delete({ url: '/system/user/delete?id=' + id }) |
|
48 |
} |
|
49 |
|
|
50 |
// 导出用户 |
|
51 |
export const exportUser = (params) => { |
|
52 |
return request.download({ url: '/system/user/export', params }) |
|
53 |
} |
|
54 |
|
|
55 |
// 下载用户导入模板 |
|
56 |
export const importUserTemplate = () => { |
|
57 |
return request.download({ url: '/system/user/get-import-template' }) |
|
58 |
} |
|
59 |
|
|
60 |
// 用户密码重置 |
|
61 |
export const resetUserPwd = (id: number, password: string) => { |
|
62 |
const data = { |
|
63 |
id, |
|
64 |
password |
|
65 |
} |
|
66 |
return request.put({ url: '/system/user/update-password', data: data }) |
|
67 |
} |
|
68 |
|
|
69 |
// 用户状态修改 |
|
70 |
export const updateUserStatus = (id: number, status: number) => { |
|
71 |
const data = { |
|
72 |
id, |
|
73 |
status |
|
74 |
} |
|
75 |
return request.put({ url: '/system/user/update-status', data: data }) |
|
76 |
} |
|
77 |
|
|
78 |
// 获取用户精简信息列表 |
|
79 |
export const getSimpleUserList = (): Promise<UserVO[]> => { |
|
80 |
return request.get({ url: '/system/user/simple-list' }) |
|
81 |
} |