Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0df58bc

Browse files
add: update user permission
1 parent 02402ff commit 0df58bc

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

‎src/api/url.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const USER_LOGIN_URL = '/user/login'; // 用户登录
3636
const ALL_USER_URL = '/user/allUsers'; // 全部用户信息
3737
const USER_INFO_URL = '/user/getById'; // 根据用户id进行查询
3838
const USER_UPDATE_URL = '/user/updateUser'; // 根据用户id进行更新
39+
const ADMIN_UPDATE_USER_URL = '/auth/updateUserInfo'; // 管理员对用户进行更新,支持对权限进行更新
3940
const USER_ADD_AVATAR_URL = '/user/auth/uploadUserAvatar'; // 用户增加头像
4041
const USER_CHANGE_ROLE_URL = '/user/changeUserRole'; // 改变用户角色
4142
const BLOCK_USER_URL = '/user/blockUser'; // 屏蔽/解除屏蔽用户
@@ -116,6 +117,7 @@ module.exports = {
116117
ALL_USER_URL,
117118
USER_INFO_URL,
118119
USER_UPDATE_URL,
120+
ADMIN_UPDATE_USER_URL,
119121
USER_ADD_AVATAR_URL,
120122
USER_CHANGE_ROLE_URL,
121123
BLOCK_USER_URL,

‎src/api/user.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
ALL_USER_URL,
66
USER_INFO_URL,
77
USER_UPDATE_URL,
8+
ADMIN_UPDATE_USER_URL,
89
USER_ADD_AVATAR_URL,
910
USER_CHANGE_ROLE_URL,
1011
BLOCK_USER_URL,
@@ -46,6 +47,10 @@ export default {
4647
return Put(USER_UPDATE_URL, params);
4748
},
4849

50+
updateUserByAdmin: (params) => {
51+
return Put(ADMIN_UPDATE_USER_URL, params);
52+
},
53+
4954
addUserAvatar: (params) => {
5055
return Post(USER_ADD_AVATAR_URL, params)
5156
},

‎src/views/users/EditUserInfo.vue‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,10 @@ export default {
126126
mail: this.userInfo.mail,
127127
male: this.userInfo.gender === 'male',
128128
description: this.userInfo.desc,
129-
birthtime: this.userInfo.date
129+
birthtime: this.userInfo.date,
130+
role: this.userInfo.permissionEnum
130131
}
131-
await UserRequest.updateUser(param).then(res => {
132+
await UserRequest.updateUserByAdmin(param).then(res => {
132133
if (res.code === 200) {
133134
this.$Message.success("更新成功")
134135
} else {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /