mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-13 12:02:51 +00:00
perf: 优化登录设备名称
This commit is contained in:
parent
ffa09f1b29
commit
03fc19f070
@ -129,11 +129,35 @@ class UserDevice extends AbstractModel
|
|||||||
|
|
||||||
if (preg_match("/android_kuaifan_eeui/i", $ua)) {
|
if (preg_match("/android_kuaifan_eeui/i", $ua)) {
|
||||||
// Android 客户端
|
// Android 客户端
|
||||||
|
if ($dd->getBrandName() && $dd->getModel()) {
|
||||||
|
// 厂商+型号
|
||||||
|
$result['app_type'] = $dd->getBrandName() . ' ' . $dd->getModel();
|
||||||
|
} elseif ($dd->getBrandName()) {
|
||||||
|
// 仅厂商
|
||||||
|
$result['app_type'] = $dd->getBrandName();
|
||||||
|
} elseif ($dd->isTablet()) {
|
||||||
|
// 平板
|
||||||
|
$result['app_type'] = 'Tablet';
|
||||||
|
} elseif ($dd->isPhablet()) {
|
||||||
|
// 平板
|
||||||
|
$result['app_type'] = 'Phablet';
|
||||||
|
} else {
|
||||||
|
// 未确定的 Android 设备
|
||||||
$result['app_type'] = 'Android';
|
$result['app_type'] = 'Android';
|
||||||
|
}
|
||||||
$result['app_version'] = self::getAfterVersion($ua, 'kuaifan_eeui/');
|
$result['app_version'] = self::getAfterVersion($ua, 'kuaifan_eeui/');
|
||||||
} elseif (preg_match("/ios_kuaifan_eeui/i", $ua)) {
|
} elseif (preg_match("/ios_kuaifan_eeui/i", $ua)) {
|
||||||
// iOS 客户端
|
// iOS 客户端
|
||||||
|
if (preg_match("/(macintosh|ipad)/i", $ua)) {
|
||||||
|
// iPad
|
||||||
|
$result['app_type'] = 'iPad';
|
||||||
|
} elseif (preg_match("/iphone/i", $ua)) {
|
||||||
|
// iPhone
|
||||||
|
$result['app_type'] = 'iPhone';
|
||||||
|
} else {
|
||||||
|
// 未确定的 iOS 设备
|
||||||
$result['app_type'] = 'iOS';
|
$result['app_type'] = 'iOS';
|
||||||
|
}
|
||||||
$result['app_version'] = self::getAfterVersion($ua, 'kuaifan_eeui/');
|
$result['app_version'] = self::getAfterVersion($ua, 'kuaifan_eeui/');
|
||||||
} elseif (preg_match("/dootask/i", $ua)) {
|
} elseif (preg_match("/dootask/i", $ua)) {
|
||||||
// DooTask 客户端
|
// DooTask 客户端
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user