|
@ -27,6 +27,7 @@ using Abp.Domain.Repositories; |
|
|
using System.Runtime.Intrinsics.X86; |
|
|
using System.Runtime.Intrinsics.X86; |
|
|
using System.Text; |
|
|
using System.Text; |
|
|
using System.IO; |
|
|
using System.IO; |
|
|
|
|
|
using Abp.AutoMapper; |
|
|
|
|
|
|
|
|
namespace BCS.BMC.Controllers |
|
|
namespace BCS.BMC.Controllers |
|
|
{ |
|
|
{ |
|
@ -246,14 +247,17 @@ namespace BCS.BMC.Controllers |
|
|
return SimpleStringCipher.Instance.Encrypt(accessToken); |
|
|
return SimpleStringCipher.Instance.Encrypt(accessToken); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[HttpGet] |
|
|
|
|
|
|
|
|
[HttpPost] |
|
|
public async Task<ActionResult> ValidateTenancy([FromBody] GetUrlDto input) |
|
|
public async Task<ActionResult> ValidateTenancy([FromBody] GetUrlDto input) |
|
|
{ |
|
|
{ |
|
|
|
|
|
Uri uri = new Uri(input.InputUrl, UriKind.Absolute); |
|
|
|
|
|
var domain = uri.Host; |
|
|
|
|
|
|
|
|
if (input.InputUrl == null) |
|
|
if (input.InputUrl == null) |
|
|
{ |
|
|
{ |
|
|
return BadRequest(); |
|
|
return BadRequest(); |
|
|
} |
|
|
} |
|
|
var company = await _companyMaster.FirstOrDefaultAsync(x => x.Url == input.InputUrl.ToString()); |
|
|
|
|
|
|
|
|
var company = await _companyMaster.FirstOrDefaultAsync(x => x.Url == input.InputUrl.ToString() || x.DomainName == domain); |
|
|
if (company == null) |
|
|
if (company == null) |
|
|
{ |
|
|
{ |
|
|
return BadRequest(); |
|
|
return BadRequest(); |
|
|