Browse Source

[WHAT] 忘記密碼API增加頁面導向 [WHY] 開發 ShowEasy 後臺

Dev
Janie 2 years ago
parent
commit
3e7fe483f5
  1. 3
      EuroTran/EasyBL.WEBAPP/ShowEasy/SignupService.cs
  2. 12
      EuroTran/WebApp/Controllers/SignupController.cs

3
EuroTran/EasyBL.WEBAPP/ShowEasy/SignupService.cs

@ -337,7 +337,7 @@ namespace EasyBL.WEBAPP.SYS
var bSend = new MailService(sOrgID, true).MailFactory(oEmail, out sError); var bSend = new MailService(sOrgID, true).MailFactory(oEmail, out sError);
srm = new SuccessResponseMessage(null, null); srm = new SuccessResponseMessage(null, null);
srm.DATA.Add(BLWording.REL, Mailto.MemberID);
srm.DATA.Add(BLWording.REL, Mailto.Email);
} while (false); } while (false);
return srm; return srm;
@ -457,6 +457,7 @@ namespace EasyBL.WEBAPP.SYS
{ {
do do
{ {
Console.WriteLine(Email);
var sUser = db.Queryable<SETB_CMS_Member>().Single(x => x.Email == Email); var sUser = db.Queryable<SETB_CMS_Member>().Single(x => x.Email == Email);
sUser.Password = SecurityUtil.Encrypt(Password); //新密碼加密 sUser.Password = SecurityUtil.Encrypt(Password); //新密碼加密
var iRel = db.Updateable(sUser).ExecuteCommand(); //將新密碼更新至資料庫 var iRel = db.Updateable(sUser).ExecuteCommand(); //將新密碼更新至資料庫

12
EuroTran/WebApp/Controllers/SignupController.cs

@ -67,7 +67,17 @@ namespace WebApp.Controllers
public HttpResponseMessage ResetPage(string Email) public HttpResponseMessage ResetPage(string Email)
{ {
return new SignupService().ResetPage(Email);
var result = new SignupService().ResetPage(Email);
var Server = Common.ConfigGetValue("", "ida:WebsiteUri");
if (result.ReasonPhrase == "OK")
{
result = Request.CreateResponse(HttpStatusCode.Moved);
result.Headers.Location = new Uri(Server + "/user/forgot"); //在API Header加入要導向的Location Url
}
return result;
//return new SignupService().ResetPage(Email);
} }

Loading…
Cancel
Save