Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
6930bf87bd
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      app/admin/hdl/hdl_role.go

+ 9
- 0
app/admin/hdl/hdl_role.go View File

@@ -424,6 +424,15 @@ func AddAdmin(c *gin.Context) {
} }
admDb := db.AdminDb{} admDb := db.AdminDb{}
admDb.Set() admDb.Set()
isHasAdmin, err := admDb.GetAdminByUserName(req.Username)
if err != nil {
e.OutErr(c, e.ERR_DB_ORM, err.Error())
return
}
if isHasAdmin != nil {
e.OutErr(c, e.ERR, "当前用户名已存在,请勿重复添加")
return
}


admId, err := admDb.CreateAdminId() admId, err := admDb.CreateAdminId()
if err != nil { if err != nil {


Loading…
Cancel
Save