增加判断服务器类型;更新初始化数据sql

This commit is contained in:
2020-03-20 18:38:39 +08:00
parent 7d8d2c5461
commit 0c8f6dc6ed
7 changed files with 2277 additions and 3055 deletions
+2 -1
View File
@@ -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);//用户名
}
+28
View File
@@ -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 处理部分