//解析微信文章内容 public string Analysis(string url, string cookie, string wh) { if (string.IsNullOrWhiteSpace(url)) { return("1"); } if (string.IsNullOrWhiteSpace(cookie)) { return("2"); } else { ObjSessionModel obj = handle.AnalyzeCookie.Analyze(cookie); if (obj == null) { return("3"); } else { return(handle.UploadPage.Load(url, obj.userId, wh)); } } }
//解析cookie public static ObjSessionModel Analyze(string cookie) { try { string res = handle.DES.Decode(cookie); ObjSessionModel obj = Newtonsoft.Json.JsonConvert.DeserializeObject <ObjSessionModel>(res); obj.userId = obj.userId.Trim(); return(obj); //TimeSpan tm = DateTime.Now - DateTime.Parse(obj.loginTime); //if (tm.Minutes > 1440) //{ // return null; //} //else //{ // return obj; //} } catch (Exception e) { return(null); } }
//检查是否是vip用户 public object Get(string cookie) { if (string.IsNullOrWhiteSpace(cookie)) { return(ReturnResult.Return("1", "cookie错误", null, null)); } else { ObjSessionModel obj = handle.AnalyzeCookie.Analyze(cookie); if (obj == null) { return(ReturnResult.Return("1", "cookie错误", null, null)); } else { return(handle.CheckAuthorization.Check(obj.userId)); } } }