|
@@ -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 { |
|
|