| | |
| | | private void BtnEditPwd_Click(object sender, EventArgs e) |
| | | { |
| | | var dlg = new UpdatePwdDlg(); |
| | | dlg.SetBindingData(GlobalParas._GlobalParas.LoginID); |
| | | dlg.SetBindingData(LoginUserInfo.LoginAccountID); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | |
| | | var loginType = await BLLFactory<Yw.BLL.UserLoginType>.Instance.GetByIdentifier(LoginType.SMS); |
| | | if (loginType != null) |
| | | { |
| | | var isExist = await BLLFactory<Yw.BLL.UserLoginAccount>.Instance.IsExist(new IsExistUserLoginAccountInput |
| | | { |
| | | CorpID = GlobalParas._GlobalParas.CorpID, |
| | | LoginTypeID = loginType.ID, |
| | | Identifier = _smsTemplate, |
| | | Credential = this.txtMobileNumber.Text.Trim() |
| | | }); |
| | | var isExist = await BLLFactory<Yw.BLL.UserLoginAccount>.Instance.IsExist |
| | | ( |
| | | Yw.WinFrmUI.LoginUserInfo.CorpID, |
| | | Yw.WinFrmUI.LoginUserInfo.UserID, |
| | | _smsTemplate, |
| | | this.txtMobileNumber.Text.Trim() |
| | | ); |
| | | if (isExist) |
| | | { |
| | | TipFormHelper.ShowError("账户已存在!"); |
| | | return; |
| | | } |
| | | var vmo = new Yw.Vmo.AddUserLoginAccountVmo(); |
| | | vmo.CorpID = GlobalParas._GlobalParas.CorpID; |
| | | vmo.UserID = GlobalParas._GlobalParas.UserID; |
| | | vmo.LoginTypeID = loginType.ID; |
| | | vmo.Identifier = _smsTemplate; |
| | | vmo.Credential = this.txtMobileNumber.Text.Trim(); |
| | | vmo.IfVerified = true; |
| | | var vmo = new Yw.Vmo.AddUserLoginAccountVmo() |
| | | { |
| | | CorpID = Yw.WinFrmUI.LoginUserInfo.CorpID, |
| | | UserID = Yw.WinFrmUI.LoginUserInfo.UserID, |
| | | LoginTypeID = loginType.ID, |
| | | Identifier = _smsTemplate, |
| | | Credential = this.txtMobileNumber.Text.Trim(), |
| | | IfVerified = true |
| | | }; |
| | | var bol = await BLLFactory<Yw.BLL.UserLoginAccount>.Instance.Insert(vmo); |
| | | if (bol > 0) |
| | | { |
| | |
| | | { |
| | | var tokenInfo = await BLLFactory<Yw.BLL.ToolWechat>.Instance.GetTokenInfo(code, _vxTemplate); |
| | | if (tokenInfo == null) |
| | | return; |
| | | var isExist = await BLLFactory<Yw.BLL.UserLoginAccount>.Instance.IsExist(new IsExistUserLoginAccountInput |
| | | { |
| | | CorpID = GlobalParas._GlobalParas.CorpID, |
| | | LoginTypeID = loginType.ID, |
| | | Identifier = _vxTemplate, |
| | | Credential = tokenInfo.openid |
| | | }); |
| | | return; |
| | | } |
| | | var userInfo = await BLLFactory<Yw.BLL.ToolWechat>.Instance.GetUserInfo(tokenInfo.access_token, tokenInfo.openid); |
| | | if (userInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var isExist = await BLLFactory<Yw.BLL.UserLoginAccount>.Instance.IsExist |
| | | ( |
| | | Yw.WinFrmUI.LoginUserInfo.CorpID, |
| | | loginType.ID, |
| | | _vxTemplate, |
| | | tokenInfo.openid |
| | | ); |
| | | if (isExist) |
| | | { |
| | | TipFormHelper.ShowError("账户已存在!"); |
| | | return; |
| | | } |
| | | var vmo = new Yw.Vmo.AddUserLoginAccountVmo(); |
| | | vmo.CorpID = GlobalParas._GlobalParas.CorpID; |
| | | vmo.UserID = GlobalParas._GlobalParas.UserID; |
| | | vmo.LoginTypeID = loginType.ID; |
| | | vmo.Identifier = _vxTemplate; |
| | | vmo.Credential = tokenInfo.openid; |
| | | vmo.IfVerified = true; |
| | | |
| | | var vmo = new Yw.Vmo.AddUserLoginAccountVmo() |
| | | { |
| | | CorpID = Yw.WinFrmUI.LoginUserInfo.CorpID, |
| | | UserID = Yw.WinFrmUI.LoginUserInfo.UserID, |
| | | LoginTypeID = loginType.ID, |
| | | Identifier = _vxTemplate, |
| | | Credential = tokenInfo.openid, |
| | | IfVerified = true, |
| | | ExtraInfo = JsonHelper.Object2Json(userInfo) |
| | | }; |
| | | |
| | | var bol = await BLLFactory<Yw.BLL.UserLoginAccount>.Instance.Insert(vmo); |
| | | if (bol > 0) |
| | | { |