日志记录辅助函数测试
This commit is contained in:
@@ -40,6 +40,7 @@ if (!function_exists('get_device_type')) {
|
||||
'isTablet' => false,
|
||||
'deviceType' => 'Desktop',
|
||||
'browser' => '',
|
||||
'platform' => ''
|
||||
];
|
||||
|
||||
// 检查是否为移动设备
|
||||
@@ -68,7 +69,9 @@ if (!function_exists('get_device_type')) {
|
||||
}
|
||||
|
||||
// 确定操作系统平台
|
||||
if (strpos($userAgent, 'Windows NT 10.0') !== false) {
|
||||
if (strpos($userAgent, 'Windows NT 10.0; Win64; x64') !== false && strpos($userAgent, 'WOW64') === false) {
|
||||
$deviceInfo['platform'] = 'Windows 11';
|
||||
} elseif (strpos($userAgent, 'Windows NT 10.0') !== false) {
|
||||
$deviceInfo['platform'] = 'Windows 10';
|
||||
} elseif (strpos($userAgent, 'Windows NT 6.3') !== false) {
|
||||
$deviceInfo['platform'] = 'Windows 8.1';
|
||||
|
||||
Reference in New Issue
Block a user