Browse Source

[WHAT] ip位址 [WHY] 開發 ShowEasy 後臺

Dev
Janie 2 years ago
parent
commit
d02da57396
  1. 51
      EuroTran/EasyBL.WEBAPP/ShowEasy/SignupService.cs
  2. 2
      EuroTran/WebApp/Web.config

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

@ -23,15 +23,22 @@ namespace EasyBL.WEBAPP.SYS
{ {
public class SignupService : ServiceBase public class SignupService : ServiceBase
{ {
public static string SERVER_IP = "localhost";
public static string SERVER_PORT = "3466";
//public static string SERVER_IP = "localhost";
//public static string SERVER_PORT = "3466";
public static string SERVER_IP = "www.origtek.com";
public static string SERVER_PORT = "9105";
//使用者以信箱註冊 //使用者以信箱註冊
public HttpResponseMessage SignupWithEmail(SETB_CMS_Member newUser) public HttpResponseMessage SignupWithEmail(SETB_CMS_Member newUser)
{ {
//string sMsg = null; //string sMsg = null;
SuccessResponseMessage srm = SugarBase.ExecTran(db =>
{
SuccessResponseMessage srm = null;
var db = SugarBase.GetIntance();
string sError = null;
try {
do do
{ {
string sAccount = newUser.Email; string sAccount = newUser.Email;
@ -45,7 +52,17 @@ namespace EasyBL.WEBAPP.SYS
string sStatus = "0"; //會員狀態為未驗證(F) string sStatus = "0"; //會員狀態為未驗證(F)
string sType = "Email"; string sType = "Email";
string sError = ""; //寄信若有錯誤回傳之訊息
var checkAccount = db.Queryable<SETB_CMS_Member>()
.Where(x => x.OrgID == sOrgID && x.Account == sAccount)
.Count();
if (checkAccount > 0)
{
sError = @"該帳號已註冊"; //該帳號無效
break;
}
string sEncryptPwd = SecurityUtil.Encrypt(sPassword); //密碼加密 string sEncryptPwd = SecurityUtil.Encrypt(sPassword); //密碼加密
newUser.MemberID = sMemberID; newUser.MemberID = sMemberID;
@ -55,6 +72,8 @@ namespace EasyBL.WEBAPP.SYS
newUser.Account = newUser.Email; newUser.Account = newUser.Email;
newUser.MemberType = sType; newUser.MemberType = sType;
var iRel = db.Insertable(newUser).ExecuteCommand();
//開始寄信 //開始寄信
var oEmail = new Emails(); //寄件人 var oEmail = new Emails(); //寄件人
var toEmail = new List<EmailTo>(); //收件人 var toEmail = new List<EmailTo>(); //收件人
@ -74,15 +93,25 @@ namespace EasyBL.WEBAPP.SYS
oEmail.EmailTo = toEmail; oEmail.EmailTo = toEmail;
var bSend = new MailService(sOrgID, true).MailFactory(oEmail, out sError); var bSend = new MailService(sOrgID, true).MailFactory(oEmail, out sError);
var iRel = db.Insertable(newUser).ExecuteCommand();
srm = new SuccessResponseMessage(null, null); srm = new SuccessResponseMessage(null, null);
srm.DATA.Add(BLWording.REL, newUser); srm.DATA.Add(BLWording.REL, newUser);
} while (false); } while (false);
return srm;
});
}
catch (Exception ex)
{
sError = Util.GetLastExceptionMsg(ex);
}
finally
{
if (null != sError)
{
srm = new SuccessResponseMessage(null, null)
{
STATUSCODE = (int)StatusCodeEnum.ParameterError,
MSG = sError
};
}
}
return HttpResponseExtension.ToJson(JsonConvert.SerializeObject(srm)); return HttpResponseExtension.ToJson(JsonConvert.SerializeObject(srm));
} }

2
EuroTran/WebApp/Web.config

@ -87,7 +87,7 @@
<add key="ida:AppId" value="8509ba61-9451-4960-94d8-10934d5365cc" /> <add key="ida:AppId" value="8509ba61-9451-4960-94d8-10934d5365cc" />
<add key="ida:AppPassword" value="qWWKUV056{*{)fuowwgHK31" /> <add key="ida:AppPassword" value="qWWKUV056{*{)fuowwgHK31" />
<add key="ida:RedirectUri" value="http://localhost:3466" /> <add key="ida:RedirectUri" value="http://localhost:3466" />
<add key="ida:WebsiteUri" value="http://localhost:3001" />
<add key="ida:WebsiteUri" value="http://localhost:3000" />
<add key="ida:AppScopes" value=" User.Read Mail.ReadWrite Mail.Send Calendars.ReadWrite Contacts.Read Contacts.ReadWrite" /> <add key="ida:AppScopes" value=" User.Read Mail.ReadWrite Mail.Send Calendars.ReadWrite Contacts.Read Contacts.ReadWrite" />
<add key="ida:GraphRootUri" value="https://graph.microsoft.com/beta" /> <add key="ida:GraphRootUri" value="https://graph.microsoft.com/beta" />
</appSettings> </appSettings>

Loading…
Cancel
Save