Browse Source

DecryptPassword API

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

44
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<SETB_CMS_Member>().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));
}
}
}

15
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);
}
}
}
Loading…
Cancel
Save