header('platform')); $platformMap = [ 'h5' => 'H5', 'pc' => 'Pc', 'app' => 'App', 'wxminiprogram' => 'wxMiniProgram', 'wxofficialaccount' => 'wxOfficialAccount', 'dyminiprogram' => 'dyMiniProgram', 'channels' => 'channels', ]; $key = strtolower($platform); return isset($platformMap[$key]) ? $platformMap[$key] : $platform; } /** * 获取设备终端 * @return string */ public static function getDeviceEnd(){ if(strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone')||strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')){ return 'ios'; }else if(strpos($_SERVER['HTTP_USER_AGENT'], 'Android')){ return 'android'; }else{ return 'other'; } } /** * 获取系统类型 独立版 or 微擎版 * @return void */ public static function getSystemType(){ if(defined('TUZHI_SYSTEM_TYPE') && TUZHI_SYSTEM_TYPE == 'single'){ return 'single'; } return 'w7'; } }