fix: 无法判断出是ipad的情况

This commit is contained in:
2025-06-19 10:08:40 +08:00
parent 5ff7bd4423
commit 9a817b4acc
2 changed files with 7 additions and 2 deletions

View File

@@ -2,8 +2,12 @@
// +----------------------------------------------------------------------
// | 模板设置
// +----------------------------------------------------------------------
use Detection\MobileDetect;
$detect = new MobileDetect();
$view_device_name = 'pc';
if (request()->isMobile()) {
if ($detect->isMobile() || $detect->isTablet()) {
$view_device_name = 'mobile';
}

View File

@@ -33,7 +33,8 @@
"intervention/image": "^3.10",
"topthink/think-cors": "^1.0",
"phpoffice/phpspreadsheet": "^3.8",
"friendsofsymfony/oauth2-php": "^1.3"
"friendsofsymfony/oauth2-php": "^1.3",
"mobiledetect/mobiledetectlib": "4.8.09"
},
"require-dev": {
"symfony/var-dumper": ">=4.2",