1
This commit is contained in:
@@ -161,4 +161,9 @@ public interface IUserManager
|
||||
/// 获取管理员用户id.
|
||||
/// </summary>
|
||||
string GetAdminUserId();
|
||||
|
||||
/// <summary>
|
||||
/// 域名
|
||||
/// </summary>
|
||||
string Domain{ get; }
|
||||
}
|
||||
@@ -6,5 +6,36 @@
|
||||
public partial class UserManager
|
||||
{
|
||||
public static string AsscessToken { get; set; }
|
||||
|
||||
public string Domain
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
string host = "";
|
||||
if (App.HttpContext != null)
|
||||
{
|
||||
host = (App.HttpContext.Request.IsHttps ? "https://" : "http://") + App.HttpContext.Request.Host;
|
||||
}
|
||||
else
|
||||
{
|
||||
var datatable = _repository.AsSugarClient().Ado
|
||||
.GetDataTable("select * from bas_factory_config where key='domain' limit 1");
|
||||
if (datatable.Rows.Count > 0)
|
||||
{
|
||||
host = datatable.Rows[0]["value"].ToString();
|
||||
Console.WriteLine(host);
|
||||
}
|
||||
}
|
||||
return host;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return "http://tnb.tuotong-tech.com";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user