/// <summary> /// 业务逻辑处理 /// </summary> /// <returns>false:中断后面的方式执行并返回Error</returns> public override bool TakeAction() { try { if (_openid != "") { var q = SnsManager.Register(_openid, "123456", "", true); var s = SnsManager.RegisterWeixin(_openid, "123456", "", _openid); SnsUser _tempu = SnsManager.LoginByWeixin(_openid); passport = _tempu.PassportId; password = _tempu.Password; _tempu.RetailUser = _openid; _tempu.RetailID = retailID; _tempu.WeixinCode = _openid; SnsManager.ChangeUserInfo(passport, _tempu); } else { string[] userList = SnsManager.GetRegPassport(deviceID); passport = userList[0]; password = userList[1]; } sc_device _scd = new sc_device() { fn = "sc_device", result = 1 }; _scd.passportid = passport; _scd.password = password; _senddata = JsonUtils.Serialize(_scd); return(true); } catch (Exception ex) { this.SaveLog(ex); this.ErrorCode = Language.Instance.ErrorCode; this.ErrorInfo = Language.Instance.St1002_GetRegisterPassportIDError; return(false); } }
/// <summary> /// 业务逻辑处理 /// </summary> /// <returns>false:中断后面的方式执行并返回Error</returns> public override bool TakeAction() { try { string _pid = ""; bool _isExiste = false; SnsUser _snsuser = SnsManager.LoginByWeixin(_openid); if (string.IsNullOrEmpty(_snsuser.WeixinCode)) {//注册绑定 ////var q = SnsManager.Register(_openid, "123456", "", true); ////var s = SnsManager.RegisterWeixin(_openid, "123456", "", _openid); ////SnsUser _tempu = SnsManager.LoginByWeixin(_openid); ////_pid = _tempu.PassportId; ////_userid = _tempu.UserId; } else { _isExiste = true; _pid = _snsuser.PassportId; ////_userid = _snsuser.UserId; } sc_getexiste_openid _scd = new sc_getexiste_openid() { fn = "sc_getexiste_openid", result = 1 }; _scd._existe = _isExiste; //------------------------------ _scd._pid = _pid; _senddata = JsonUtils.Serialize(_scd); return(true); } catch (Exception ex) { ErrorRecord.Record("20170216 验证帐号时就不对了"); this.SaveLog(ex); this.ErrorCode = 10086; return(false); } }