public async Task <IActionResult> ReLogin(Models.ViewModel.HisLoginViewModel model) { try { if (model.StationId <= 0) { throw new Exception(); } var login = UserMgr.GetMyLoginData(UserSelf.LoginId); if (!model.DepartId.HasValue) { model.DepartId = findDepartId(login.DoctorId.Value, model.StationId); } await SignInProcess(login, model.StationId, model.DepartId, model.LoginExtMobile); await Logger.WriteInfoAsync("Home", "Login", $"用户({login.CustomerId},{login.CustomerName})切换登录到工作站({model.StationId})"); return(RedirectToAction("LoginedDefault")); //登录到默认页面 } catch (Exception ex) { ModelState.AddModelError("", ex.Message); return(View("Login", model)); } }
public async Task <IActionResult> SendEmailVCode(string newEmail) { try { StringBuilder b = new StringBuilder(); var u = UserSelf; var cus = UserMgr.GetMyLoginData(u.LoginId); b.AppendFormat("尊敬的用户 <b> {0} </b>:<br>", cus.CustomerName); b.Append("您正在更换新的邮箱,请点击下面的链接,确认您的邮箱。<br><br>"); string c = string.Format("origemail={0},newemail={1},datetime={2:yyyyMMddTHHmmss}", cus.Email, newEmail, DateTime.Now); string cc = Ass.Data.Secret.Encript(c, Global.SYS_ENCRIPT_PWD); string link = "http://www/MyPanel/VerifyEmail?c=" + cc; b.AppendFormat("<a href='{0}'>{0}</a><br><br>", link); b.Append("天使健康开发团队<br>"); b.AppendFormat("{0:yyyy年MM月dd日 HH:mm:ss}", DateTime.Now); await new SendVCodeCBL(this).SendEmailHtmlAsync(newEmail, b.ToString()); return(Json(new { rlt = true })); } catch (Exception ex) { return(Json(new { rlt = false, msg = ex.Message })); } }