From 3e7fe483f599f99a6e27e0b2642f27d2a8fbbe48 Mon Sep 17 00:00:00 2001 From: Janie <109517022+Janie06@users.noreply.github.com> Date: Tue, 7 Feb 2023 15:39:34 +0800 Subject: [PATCH] =?UTF-8?q?[WHAT]=20=E5=BF=98=E8=A8=98=E5=AF=86=E7=A2=BCAP?= =?UTF-8?q?I=E5=A2=9E=E5=8A=A0=E9=A0=81=E9=9D=A2=E5=B0=8E=E5=90=91=20[WHY]?= =?UTF-8?q?=20=E9=96=8B=E7=99=BC=20ShowEasy=20=E5=BE=8C=E8=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EuroTran/EasyBL.WEBAPP/ShowEasy/SignupService.cs | 3 ++- EuroTran/WebApp/Controllers/SignupController.cs | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/EuroTran/EasyBL.WEBAPP/ShowEasy/SignupService.cs b/EuroTran/EasyBL.WEBAPP/ShowEasy/SignupService.cs index f8dba28..793229d 100644 --- a/EuroTran/EasyBL.WEBAPP/ShowEasy/SignupService.cs +++ b/EuroTran/EasyBL.WEBAPP/ShowEasy/SignupService.cs @@ -337,7 +337,7 @@ namespace EasyBL.WEBAPP.SYS var bSend = new MailService(sOrgID, true).MailFactory(oEmail, out sError); srm = new SuccessResponseMessage(null, null); - srm.DATA.Add(BLWording.REL, Mailto.MemberID); + srm.DATA.Add(BLWording.REL, Mailto.Email); } while (false); return srm; @@ -457,6 +457,7 @@ namespace EasyBL.WEBAPP.SYS { do { + Console.WriteLine(Email); var sUser = db.Queryable().Single(x => x.Email == Email); sUser.Password = SecurityUtil.Encrypt(Password); //新密碼加密 var iRel = db.Updateable(sUser).ExecuteCommand(); //將新密碼更新至資料庫 diff --git a/EuroTran/WebApp/Controllers/SignupController.cs b/EuroTran/WebApp/Controllers/SignupController.cs index d7d5e18..57d25f7 100644 --- a/EuroTran/WebApp/Controllers/SignupController.cs +++ b/EuroTran/WebApp/Controllers/SignupController.cs @@ -67,7 +67,17 @@ namespace WebApp.Controllers 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); }