parent
7466ef21e5
commit
5b7c1fb8fe
|
@ -114,6 +114,10 @@ func (userService *UserService) SetUserAuthorities(id uint, authorityIds []strin
|
|||
if TxErr != nil {
|
||||
return TxErr
|
||||
}
|
||||
TxErr = tx.Where("id = ?", id).First(&system.SysUser{}).Update("authority_id", authorityIds[0]).Error
|
||||
if TxErr != nil {
|
||||
return TxErr
|
||||
}
|
||||
// 返回 nil 提交事务
|
||||
return nil
|
||||
})
|
||||
|
|
|
@ -162,7 +162,7 @@ export default {
|
|||
methods: {
|
||||
setAuthorityIds() {
|
||||
this.tableData && this.tableData.forEach((user) => {
|
||||
const authorityIds = user.authorities && user.authorities.forEach(i => {
|
||||
const authorityIds = user.authorities && user.authorities.map(i => {
|
||||
return i.authorityId
|
||||
})
|
||||
user.authorityIds = authorityIds
|
||||
|
|
Loading…
Reference in New Issue