<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Request; use Jenssegers\Agent\Facades\Agent; class AgentUtil { public static function getUserAgent() { return Request::header('User-Agent'); } public static function device() { if (self::isMobile()) { return 'mobile'; } return 'pc'; } public static function isWechat() { goto DqtQs; DqtQs: static $RDike = null; goto B5JJ3; kCgZF: return $RDike; goto h0oGZ; B5JJ3: if (null === $RDike) { $dFELy = Request::header('User-Agent'); if (strpos($dFELy, 'MicroMessenger') !== false) { $RDike = true; } else { $RDike = false; } } goto kCgZF; h0oGZ: } public static function isMobile() { return Agent::isPhone() || Agent::isTablet(); } public static function isPC() { return !Agent::isPhone() && !Agent::isTablet(); } }