[系统用户]系统用户可以设置启用/禁用

This commit is contained in:
刘祥超
2020-12-03 19:14:35 +08:00
parent 5f0e7833a0
commit c46de3ae04
2 changed files with 4 additions and 2 deletions

View File

@@ -88,6 +88,7 @@ func (this *AdminDAO) CheckAdminPassword(username string, encryptedPassword stri
Attr("username", username).
Attr("password", encryptedPassword).
Attr("state", AdminStateEnabled).
Attr("isOn", true).
ResultPk().
FindInt64Col(0)
}
@@ -154,7 +155,7 @@ func (this *AdminDAO) UpdateAdminInfo(adminId int64, fullname string) error {
}
// 修改管理员详细信息
func (this *AdminDAO) UpdateAdmin(adminId int64, username string, password string, fullname string, isSuper bool, modulesJSON []byte) error {
func (this *AdminDAO) UpdateAdmin(adminId int64, username string, password string, fullname string, isSuper bool, modulesJSON []byte, isOn bool) error {
if adminId <= 0 {
return errors.New("invalid adminId")
}
@@ -171,6 +172,7 @@ func (this *AdminDAO) UpdateAdmin(adminId int64, username string, password strin
} else {
op.Modules = "[]"
}
op.IsOn = isOn
_, err := this.Save(op)
return err
}