Example #1
0
 public IActionResult AddAdmin(Admin admin)
 {
     if (!JudgeRoles(1))
     {
         return(Json(new { code = -1, msg = "您没有权限进行此操作!" }));
     }
     if (AdminSystem.AddAdmin(admin))
     {
         AdminSystem.AddLog(GetAdminName(), "添加新管理员:" + admin.Username);
         return(Json(new { code = 0, msg = "成功添加新管理员!" }));
     }
     return(Json(new { code = -1, msg = "添加管理员失败,请检查您输入的信息!" }));
 }