Browse Source

[WHAT] 忘記密碼 [WHY] 開發 ShowEasy API

返回url帶參數Email
Dev
Janie 2 years ago
parent
commit
197239daa9
  1. 6
      EuroTran/EasyBL.WEBAPP/ShowEasy/SignupService.cs
  2. 7
      EuroTran/WebApp/Controllers/SignupController.cs

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

@ -416,7 +416,7 @@ namespace EasyBL.WEBAPP.SYS
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
EmailTemplate_CH mailTemplate = new EmailTemplate_CH(); EmailTemplate_CH mailTemplate = new EmailTemplate_CH();
var Server = Common.ConfigGetValue("", "ida:SERVER");
var Server = Common.ConfigGetValue("", "ida:RedirectUri");
sb.Append(mailTemplate.MailHeader()); sb.Append(mailTemplate.MailHeader());
@ -473,7 +473,9 @@ namespace EasyBL.WEBAPP.SYS
sb.Append("<tr>"); sb.Append("<tr>");
sb.Append("<td class=\"s-btn s-btn__primary\" style=\"border-radius: 16px; background: #ee9546\">"); sb.Append("<td class=\"s-btn s-btn__primary\" style=\"border-radius: 16px; background: #ee9546\">");
sb.Append("<a class=\"s-btn s-btn__primary\" href=\""); sb.Append("<a class=\"s-btn s-btn__primary\" href=\"");
//sb.Append(Server + "/api/Signup/ResetPage?Email=" + Email);
sb.Append(Server + "/api/Signup/ResetPage?Email=" + Email); sb.Append(Server + "/api/Signup/ResetPage?Email=" + Email);
//sb.Append(Server + "/api/Signup/ResetPage?Email=" + Email);
sb.Append(" \" target=\"_parent\" style=\"background: #ee9546;border: 1px solid #ee9546;font-family: arial, sans-serif; font-size: 14px;line-height: 16px; color: #ffffff;text-align: center;text-decoration: none;padding: 12px 20px; display: block; border-radius: 16px; white-space: nowrap;\">"); sb.Append(" \" target=\"_parent\" style=\"background: #ee9546;border: 1px solid #ee9546;font-family: arial, sans-serif; font-size: 14px;line-height: 16px; color: #ffffff;text-align: center;text-decoration: none;padding: 12px 20px; display: block; border-radius: 16px; white-space: nowrap;\">");
sb.Append("重設密碼"); sb.Append("重設密碼");
sb.Append("</a>"); sb.Append("</a>");
@ -566,7 +568,7 @@ namespace EasyBL.WEBAPP.SYS
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
EmailTemplate_CH mailTemplate = new EmailTemplate_CH(); EmailTemplate_CH mailTemplate = new EmailTemplate_CH();
var Server = Common.ConfigGetValue("", "ida:SERVER");
var Server = Common.ConfigGetValue("", "ida:RedirectUri");
sb.Append(mailTemplate.MailHeader()); sb.Append(mailTemplate.MailHeader());

7
EuroTran/WebApp/Controllers/SignupController.cs

@ -9,6 +9,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
using System.Net.Http; using System.Net.Http;
using System.Net.Http.Headers;
using System.Web.Http; using System.Web.Http;
namespace WebApp.Controllers namespace WebApp.Controllers
@ -68,12 +69,14 @@ namespace WebApp.Controllers
{ {
var result = new SignupService().ResetPage(Email); var result = new SignupService().ResetPage(Email);
var Server = Common.ConfigGetValue("", "ida:WebsiteUri");
var Server = Common.ConfigGetValue("", "ida:WebsiteUri");
//var Server = "http://localhost:3000";
if (result.ReasonPhrase == "OK") if (result.ReasonPhrase == "OK")
{ {
result = Request.CreateResponse(HttpStatusCode.Moved); result = Request.CreateResponse(HttpStatusCode.Moved);
result.Headers.Location = new Uri(Server + "/user/forgot"); //在API Header加入要導向的Location Url
result.Headers.Location = new Uri(Server + "/user/forgot?Email=" + Email); //在API Header加入要導向的Location Url
} }
return result; return result;

Loading…
Cancel
Save