Skip to content

Commit 5b7c1fb

Browse files
author
奇淼(piexlmax
authored
fix:#746
fix:#746
1 parent 7466ef2 commit 5b7c1fb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

server/service/system/sys_user.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ func (userService *UserService) SetUserAuthorities(id uint, authorityIds []strin
114114
if TxErr != nil {
115115
return TxErr
116116
}
117+
TxErr = tx.Where("id = ?", id).First(&system.SysUser{}).Update("authority_id", authorityIds[0]).Error
118+
if TxErr != nil {
119+
return TxErr
120+
}
117121
// 返回 nil 提交事务
118122
return nil
119123
})

web/src/view/superAdmin/user/user.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export default {
162162
methods: {
163163
setAuthorityIds() {
164164
this.tableData && this.tableData.forEach((user) => {
165-
const authorityIds = user.authorities && user.authorities.forEach(i => {
165+
const authorityIds = user.authorities && user.authorities.map(i => {
166166
return i.authorityId
167167
})
168168
user.authorityIds = authorityIds

0 commit comments

Comments
 (0)