public IHttpActionResult GetNotify(string PageSize, string PageIndex, int SchoolID) { if (ModelState.IsValid) { var count = NotifyManager.GetNotifyCount(); var result = NotifyManager.GetNotify(Convert.ToInt32(PageSize), Convert.ToInt32(PageIndex), SchoolID); var data = new { result, count }; return(this.SendData(data)); } else { return(this.ErrorData("发生异常,请重新登录")); } }
public IHttpActionResult GetNotify(string PageSize, string PageIndex) { if (ModelState.IsValid) { //通过token获取用户名 string token = HttpContext.Current.Request.Headers["token"]; var userInfo = JwtTools.DEcode(token); //调用usermanager.getuserinfo 获取用户信息 var user = UserManager.GetUserInfo(userInfo["name"]); var count = NotifyManager.GetNotifyCount(); var result = NotifyManager.GetNotify(Convert.ToInt32(PageSize), Convert.ToInt32(PageIndex), user.organizationID); var data = new { result, count }; return(this.SendData(data)); } else { return(this.ErrorData("发生异常,请重新登录")); } }