diff --git a/EuroTran/EasyBL.WEBAPP/ShowEasy/SignupService.cs b/EuroTran/EasyBL.WEBAPP/ShowEasy/SignupService.cs index a7e3292..5b74fbb 100644 --- a/EuroTran/EasyBL.WEBAPP/ShowEasy/SignupService.cs +++ b/EuroTran/EasyBL.WEBAPP/ShowEasy/SignupService.cs @@ -24,7 +24,7 @@ namespace EasyBL.WEBAPP.SYS public class SignupService : ServiceBase { //public static string SERVER_IP = "localhost"; - // public static string SERVER_PORT = "3466"; + // public static string SERVER_PORT = "3466"; //public static string SERVER_IP = "www.origtek.com"; //public static string SERVER_PORT = "9105"; @@ -264,7 +264,7 @@ namespace EasyBL.WEBAPP.SYS //} srm = new SuccessResponseMessage(null, null); - srm.DATA.Add(BLWording.REL, Mailto.MemberID); + srm.DATA.Add(BLWording.REL, Mailto); } while (false); return srm; @@ -1114,6 +1114,46 @@ namespace EasyBL.WEBAPP.SYS } + //DecryptPassword + public HttpResponseMessage DecryptPassword(string OrgID, string Account) + { + //string sMsg = null; + SuccessResponseMessage srm = null; + var db = SugarBase.GetIntance(); + string sError = null; + try + { + do + { + var sUser = db.Queryable().Single(x => x.Account == Account && x.OrgID == OrgID); + + var password = SecurityUtil.Decrypt(sUser.Password); + + srm = new SuccessResponseMessage(null, null); + srm.DATA.Add(BLWording.REL, password); + } while (false); + + } + catch (Exception ex) + { + sError = Util.GetLastExceptionMsg(ex); + } + finally + { + if (null != sError) + { + srm = new SuccessResponseMessage(null, null) + { + STATUSCODE = (int)StatusCodeEnum.TokenVerifyFailed, + MSG = sError + }; + } + } + + return HttpResponseExtension.ToJson(JsonConvert.SerializeObject(srm)); + + } + } } \ No newline at end of file diff --git a/EuroTran/WebApp/Controllers/SignupController.cs b/EuroTran/WebApp/Controllers/SignupController.cs index 3895e78..a65e29a 100644 --- a/EuroTran/WebApp/Controllers/SignupController.cs +++ b/EuroTran/WebApp/Controllers/SignupController.cs @@ -16,7 +16,6 @@ namespace WebApp.Controllers { public class SignupController : ApiController { - //使用者以信箱註冊(連結) [HttpPost] public HttpResponseMessage SignupWithEmail_Link([FromBody] SETB_CMS_Member dto) @@ -100,9 +99,10 @@ namespace WebApp.Controllers //return new SignupService().ResetPage(Email); } + - //輸入新密碼 - [HttpPost] + //輸入新密碼 + [HttpPost] public HttpResponseMessage ResetPassword(string Email, string Password) { @@ -110,5 +110,14 @@ namespace WebApp.Controllers } + //解密 + [HttpPost] + public HttpResponseMessage DecryptPassword(string OrgID, string Account) + { + + return new SignupService().DecryptPassword(OrgID, Account); + + } + } }