1.修复系统用户编辑时会把密码置为空的缺陷;
This commit is contained in:
parent
499959fa41
commit
8f1e1b15d0
|
@ -403,6 +403,13 @@ func UpdateSysUser(c *gin.Context) {
|
||||||
Uid: req.Uid,
|
Uid: req.Uid,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
if req.LoginM.UserName.Username == "" {
|
||||||
|
data.LoginM.UserName = sysInfo.LoginM.UserName
|
||||||
|
}
|
||||||
|
|
||||||
|
if req.LoginM.PassWord.Password == "" {
|
||||||
|
data.LoginM.PassWord = sysInfo.LoginM.PassWord
|
||||||
|
}
|
||||||
|
|
||||||
if len(req.StoreList) != 0 {
|
if len(req.StoreList) != 0 {
|
||||||
// 将 StoreData 转换为 JSON 字符串
|
// 将 StoreData 转换为 JSON 字符串
|
||||||
|
|
|
@ -630,8 +630,8 @@ func (e *SysUser) SetPwd(pwd SysUserPwd) (Result bool, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetUserById(id uint32) *SysUserB {
|
func GetUserById(id uint32) *SysUser {
|
||||||
var u = new(SysUserB)
|
var u = new(SysUser)
|
||||||
orm.Eloquent.Table("sys_user").Where("user_id", id).First(u)
|
orm.Eloquent.Table("sys_user").Where("user_id", id).First(u)
|
||||||
|
|
||||||
return u
|
return u
|
||||||
|
@ -811,7 +811,7 @@ func AddShopperCode(req InsertSysUserReq, begin *gorm.DB) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateShopperCode 更新店员兑换码
|
// UpdateShopperCode 更新店员兑换码
|
||||||
func UpdateShopperCode(req InsertSysUserReq, begin *gorm.DB, sysInfo *SysUserB) error {
|
func UpdateShopperCode(req InsertSysUserReq, begin *gorm.DB, sysInfo *SysUser) error {
|
||||||
if req.Uid == sysInfo.Uid && req.ShopperCode == sysInfo.ShopperCode { // 兑换码没变化
|
if req.Uid == sysInfo.Uid && req.ShopperCode == sysInfo.ShopperCode { // 兑换码没变化
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user