|
|
@@ -424,6 +424,15 @@ func AddAdmin(c *gin.Context) { |
|
|
|
} |
|
|
|
admDb := db.AdminDb{} |
|
|
|
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() |
|
|
|
if err != nil { |
|
|
|