增加了用户权限设置

This commit is contained in:
pixel
2019-10-09 23:09:24 +08:00
parent 62cb6d7382
commit b3c5dfe952
5 changed files with 76 additions and 39 deletions
+3 -3
View File
@@ -54,9 +54,9 @@ func (u *User) ChangePassword(newPassword string) (err error, userInter *User) {
}
//用户更新接口
func (u *User) UpdataUser() (err error, userInter *User) {
err = qmsql.DEFAULTDB.Create(u).Error
return err, u
func (u *User) SetUserAuthority(uuid uuid.UUID, AuthorityId string) (err error) {
err = qmsql.DEFAULTDB.Where("uuid = ?", uuid).First(&User{}).Update("authority_id", AuthorityId).Error
return err
}
//用户登录