| | |
| | | |
| | | public abstract class PageHandler<T> : IHttpHandler, IRequiresSessionState where T : ISessionObject |
| | | { |
| | | public bool IsReusable |
| | | { |
| | | get |
| | | public bool IsReusable |
| | | { |
| | | return true; |
| | | get |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | public abstract JsonPageResult ProcessRequestInternal(PageContext<T> context); |
| | | public abstract JsonPageResult ProcessRequestInternal(PageContext<T> context); |
| | | |
| | | public void ProcessRequest(HttpContext context) |
| | | { |
| | | PageContext<T> context1 = new PageContext<T>(context); |
| | | JsonPageResult jsonPageResult; |
| | | try |
| | | public void ProcessRequest(HttpContext context) |
| | | { |
| | | string @string = context1.GetString("action"); |
| | | if (!context1.IsValid && @string != "login" && @string != "logout") |
| | | throw new Exception("由于长时间未操作,请重新登陆平台!"); |
| | | jsonPageResult = this.ProcessRequestInternal(context1); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | jsonPageResult = new JsonPageResult(false, (object) ex.Message); |
| | | } |
| | | IsoDateTimeConverter dateTimeConverter = new IsoDateTimeConverter(); |
| | | dateTimeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; |
| | | context.Response.ContentType = "application/json"; |
| | | string s = JsonConvert.SerializeObject((object) jsonPageResult, Formatting.Indented, new JsonConverter[1] |
| | | { |
| | | PageContext<T> context1 = new PageContext<T>(context); |
| | | JsonPageResult jsonPageResult; |
| | | try |
| | | { |
| | | string @string = context1.GetString("action"); |
| | | if (!context1.IsValid && @string != "login" && @string != "logout") |
| | | throw new Exception("由于长时间未操作,请重新登陆平台!"); |
| | | jsonPageResult = this.ProcessRequestInternal(context1); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | jsonPageResult = new JsonPageResult(false, (object)ex.Message); |
| | | } |
| | | IsoDateTimeConverter dateTimeConverter = new IsoDateTimeConverter(); |
| | | dateTimeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; |
| | | context.Response.ContentType = "application/json"; |
| | | string s = JsonConvert.SerializeObject((object)jsonPageResult, Formatting.Indented, new JsonConverter[1] |
| | | { |
| | | (JsonConverter) dateTimeConverter |
| | | }); |
| | | context.Response.Write(s); |
| | | context.Response.End(); |
| | | } |
| | | }); |
| | | context.Response.Write(s); |
| | | context.Response.End(); |
| | | } |
| | | } |