增加判断服务器类型;更新初始化数据sql
This commit is contained in:
@@ -43,7 +43,8 @@ namespace COMCMS.Common
|
||||
{
|
||||
Expires = DateTime.Now.AddMinutes(expires),
|
||||
Path = "/",
|
||||
HttpOnly = true
|
||||
HttpOnly = true,
|
||||
SameSite = SameSiteMode.Lax
|
||||
};
|
||||
MyHttpContext.Current.Response.Cookies.Append(strName, strValue, op);//用户名
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ using Microsoft.Extensions.Configuration.Json;
|
||||
using System.Net.NetworkInformation;
|
||||
using System.Linq;
|
||||
using System.Net.Sockets;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace COMCMS.Common
|
||||
{
|
||||
@@ -820,6 +821,33 @@ namespace COMCMS.Common
|
||||
return price;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前系统运行平台
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string GetOSPlatform()
|
||||
{
|
||||
string osPlatform = "Unknown";
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
osPlatform = "Windows";
|
||||
}
|
||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||
{
|
||||
osPlatform = "Linux";
|
||||
}
|
||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||
{
|
||||
osPlatform = "OSX";
|
||||
}
|
||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.FreeBSD))
|
||||
{
|
||||
osPlatform = "FreeBSD";
|
||||
}
|
||||
|
||||
return osPlatform;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 处理部分
|
||||
|
||||
Reference in New Issue
Block a user