public string Twofa() { Response.Buffer = true; Response.ExpiresAbsolute = System.DateTime.Now.AddSeconds(-1); Response.CacheControl = "no-cache"; JObject json = new JObject(); try { string deviceId = Session["openid"].ToString(); UserInfo user = (UserInfo)Session["User"]; string language = Session["language"].ToString(); string result = authMgr.getTwofa(deviceId, language, user.accountNo, user.sessionID); STReturn ret = Global.chkJsonStats(result); if (int.Parse(ret.retCode) == (int)MsgCode.OPR_SUCC) { return(result); } else { json.Add("code", ret.retCode); json.Add("msg", ret.retMsg); return(json.ToString()); } } catch (WeChatException ex) { json.RemoveAll(); json.Add("code", ex.WeChatErrorCode); json.Add("msg", ex.WeChatErrorMessage); return(json.ToString()); } catch (Exception) { json.RemoveAll(); json.Add("code", (int)MsgCode.SYSTEM_ERR); json.Add("msg", ReturnMsg.msgList[(int)MsgCode.SYSTEM_ERR]); return(json.ToString()); } }