日志记录辅助函数测试

This commit is contained in:
2024-12-03 16:48:31 +08:00
parent ac91b49ba4
commit 07a08b9e15
3 changed files with 9 additions and 1 deletions

View File

@@ -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';