|
@@ -36,8 +36,8 @@ namespace TEAMModelOS.SDK.Extension
|
|
/// 取得遠端呼叫的IP
|
|
/// 取得遠端呼叫的IP
|
|
/// </summary>
|
|
/// </summary>
|
|
public static string GetRemoteIP(this HttpContext httpContext)
|
|
public static string GetRemoteIP(this HttpContext httpContext)
|
|
- {
|
|
|
|
- return httpContext?.Connection?.RemoteIpAddress?.ToString();
|
|
|
|
|
|
+ {
|
|
|
|
+ return httpContext?.Connection?.RemoteIpAddress?.ToString();
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -65,13 +65,15 @@ namespace TEAMModelOS.SDK.Extension
|
|
/// </summary>
|
|
/// </summary>
|
|
/// <param name="key">Key Name</param>
|
|
/// <param name="key">Key Name</param>
|
|
/// <returns></returns>
|
|
/// <returns></returns>
|
|
- public static (string id,string name,string picture,string school) GetAuthTokenInfo(this HttpContext httpContext, string key = null)
|
|
|
|
- {
|
|
|
|
- object id= null,name=null, picture=null, school = null;
|
|
|
|
- httpContext?.Items.TryGetValue("ID", out id);
|
|
|
|
- httpContext?.Items.TryGetValue("School", out school);
|
|
|
|
|
|
+ public static (string id, string name, string picture, string school) GetAuthTokenInfo(this HttpContext httpContext, string key = null)
|
|
|
|
+ {
|
|
|
|
+ object id = null, name = null, picture = null, school = null;
|
|
|
|
+ httpContext?.Items.TryGetValue("ID", out id);
|
|
|
|
+ httpContext?.Items.TryGetValue("Name", out school);
|
|
|
|
+ httpContext?.Items.TryGetValue("Picture", out school);
|
|
|
|
+ httpContext?.Items.TryGetValue("School", out school);
|
|
|
|
|
|
- return (id?.ToString(), name?.ToString(), picture?.ToString(), school?.ToString());
|
|
|
|
|
|
+ return (id?.ToString(), name?.ToString(), picture?.ToString(), school?.ToString());
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -93,16 +95,16 @@ namespace TEAMModelOS.SDK.Extension
|
|
/// 取得Scheme值
|
|
/// 取得Scheme值
|
|
/// </summary>
|
|
/// </summary>
|
|
public static string GetScheme(this HttpContext httpContext)
|
|
public static string GetScheme(this HttpContext httpContext)
|
|
- {
|
|
|
|
- return httpContext?.Request?.Scheme;
|
|
|
|
|
|
+ {
|
|
|
|
+ return httpContext?.Request?.Scheme;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 取得HostName值
|
|
/// 取得HostName值
|
|
/// </summary>
|
|
/// </summary>
|
|
public static string GetHostName(this HttpContext httpContext)
|
|
public static string GetHostName(this HttpContext httpContext)
|
|
- {
|
|
|
|
- return httpContext?.Request?.Host.ToString();
|
|
|
|
|
|
+ {
|
|
|
|
+ return httpContext?.Request?.Host.ToString();
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|