public string ajax(HttpRequest req) { if (!CheckUser()) { return(JsonResultHelper.GetLoginErrorJson("登录已过期!")); } string type = req["type"]; string json = ""; switch (type) { case "Delete": json = Delete(req); break; case "New": json = New(req); break; case "Edit": json = Edit(req); break; case "Index": json = Index(req); break; default: return(JsonResultHelper.GetErrorJson("type参数不正确")); } return(json); }