提交 | 用户 | 时间
|
fd2207
|
1 |
import request from '@/utils/request' |
懒 |
2 |
import { parseStrEmpty } from "@/utils/ruoyi"; |
|
3 |
|
|
4 |
// 查询用户列表 |
|
5 |
export function listUser(query) { |
|
6 |
return request({ |
|
7 |
url: '/system/user/list', |
|
8 |
method: 'get', |
|
9 |
params: query |
|
10 |
}) |
|
11 |
} |
|
12 |
|
|
13 |
// 查询用户详细 |
|
14 |
export function getUser(userId) { |
|
15 |
return request({ |
|
16 |
url: '/system/user/' + parseStrEmpty(userId), |
|
17 |
method: 'get' |
|
18 |
}) |
|
19 |
} |
|
20 |
|
|
21 |
// 新增用户 |
|
22 |
export function addUser(data) { |
|
23 |
return request({ |
|
24 |
url: '/system/user', |
|
25 |
method: 'post', |
|
26 |
data: data |
|
27 |
}) |
|
28 |
} |
|
29 |
|
|
30 |
// 修改用户 |
|
31 |
export function updateUser(data) { |
|
32 |
return request({ |
|
33 |
url: '/system/user', |
|
34 |
method: 'put', |
|
35 |
data: data |
|
36 |
}) |
|
37 |
} |
|
38 |
|
|
39 |
// 删除用户 |
|
40 |
export function delUser(userId) { |
|
41 |
return request({ |
|
42 |
url: '/system/user/' + userId, |
|
43 |
method: 'delete' |
|
44 |
}) |
|
45 |
} |
|
46 |
|
|
47 |
// 用户密码重置 |
|
48 |
export function resetUserPwd(userId, password) { |
|
49 |
const data = { |
|
50 |
userId, |
|
51 |
password |
|
52 |
} |
|
53 |
return request({ |
|
54 |
url: '/system/user/resetPwd', |
|
55 |
method: 'put', |
|
56 |
data: data |
|
57 |
}) |
|
58 |
} |
|
59 |
|
|
60 |
// 用户状态修改 |
|
61 |
export function changeUserStatus(userId, status) { |
|
62 |
const data = { |
|
63 |
userId, |
|
64 |
status |
|
65 |
} |
|
66 |
return request({ |
|
67 |
url: '/system/user/changeStatus', |
|
68 |
method: 'put', |
|
69 |
data: data |
|
70 |
}) |
|
71 |
} |
|
72 |
|
|
73 |
// 查询用户个人信息 |
|
74 |
export function getUserProfile() { |
|
75 |
return request({ |
|
76 |
url: '/system/user/profile', |
|
77 |
method: 'get' |
|
78 |
}) |
|
79 |
} |
|
80 |
|
|
81 |
// 修改用户个人信息 |
|
82 |
export function updateUserProfile(data) { |
|
83 |
return request({ |
|
84 |
url: '/system/user/profile', |
|
85 |
method: 'put', |
|
86 |
data: data |
|
87 |
}) |
|
88 |
} |
|
89 |
|
|
90 |
// 用户密码重置 |
|
91 |
export function updateUserPwd(oldPassword, newPassword) { |
|
92 |
const data = { |
|
93 |
oldPassword, |
|
94 |
newPassword |
|
95 |
} |
|
96 |
return request({ |
|
97 |
url: '/system/user/profile/updatePwd', |
|
98 |
method: 'put', |
|
99 |
params: data |
|
100 |
}) |
|
101 |
} |
|
102 |
|
|
103 |
// 用户头像上传 |
|
104 |
export function uploadAvatar(data) { |
|
105 |
return request({ |
|
106 |
url: '/system/user/profile/avatar', |
|
107 |
method: 'post', |
|
108 |
data: data |
|
109 |
}) |
|
110 |
} |
|
111 |
|
|
112 |
// 查询授权角色 |
|
113 |
export function getAuthRole(userId) { |
|
114 |
return request({ |
|
115 |
url: '/system/user/authRole/' + userId, |
|
116 |
method: 'get' |
|
117 |
}) |
|
118 |
} |
|
119 |
|
|
120 |
// 保存授权角色 |
|
121 |
export function updateAuthRole(data) { |
|
122 |
return request({ |
|
123 |
url: '/system/user/authRole', |
|
124 |
method: 'put', |
|
125 |
params: data |
|
126 |
}) |
|
127 |
} |
|
128 |
|
|
129 |
// 查询部门下拉树结构 |
|
130 |
export function deptTreeSelect() { |
|
131 |
return request({ |
|
132 |
url: '/system/user/deptTree', |
|
133 |
method: 'get' |
|
134 |
}) |
|
135 |
} |