You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

94 lines
2.6 KiB

using EasyBL;
using EasyBL.WebApi.Filters;
using EasyBL.WEBAPP.ShowEasy;
using EasyBL.WEBAPP.SYS;
using Entity.ShowEasyDtos;
using Entity.Sugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace WebApp.Controllers
{
public class SignupController : ApiController
{
//使用者以信箱註冊
[HttpPost]
public HttpResponseMessage SignupWithEmail([FromBody] SETB_CMS_Member dto)
{
return new SignupService().SignupWithEmail(dto);
}
//重新寄送認證信
[HttpPost]
public HttpResponseMessage ReSendVerifyMail(string Email)
{
return new SignupService().ReSendVerifyMail(Email);
}
//會員認證
[HttpGet]
public HttpResponseMessage VerifyAccount(string OrgID, string MemberID)
{
var result = new SignupService().VerifyAccount(OrgID, MemberID);
var Server = Common.ConfigGetValue("", "ida:WebsiteUri");
if (result.ReasonPhrase == "OK")
{
result = Request.CreateResponse(HttpStatusCode.Moved);
result.Headers.Location = new Uri(Server);
//result.Headers.Location = this.Request.RequestUri; //在API Header加入要導向的Location Url
}
return result;
//return new SignupService().VerifyAccount(OrgID, MemberID);
}
//寄送忘記密碼信
[HttpPost]
public HttpResponseMessage SendForgotMail(string Email)
{
return new SignupService().SendForgotMail(Email);
}
//確認要修改密碼(導向修改密碼的頁面)
[HttpGet]
public HttpResponseMessage ResetPage(string 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);
}
//輸入新密碼
[HttpPost]
public HttpResponseMessage ResetPassword(string Email, string Password)
{
return new SignupService().ResetPassword(Email, Password);
}
}
}