getRootPath() . 'public/pc/index.html'; if (is_mobile()) { $template = app()->getRootPath() . 'public/mobile/index.html'; } if (file_exists($template)) { return view($template); } return '敬请期待'; } public function count(){ return $this->fetch('index', []); } /** * @notes APP下载链接跳转 * @author Tab * @date 2021/12/30 14:44 */ public function app() { if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')) { $url = ConfigService::get('app', 'ios_download_url', ''); } else { $url = ConfigService::get('app', 'android_download_url', ''); } if (empty($url)) { echo '未设置app下载链接'; exit; } if (!preg_match("/^http(s)?:\\/\\/.+/", $url)) { $url = "http://".$url; } return redirect($url); } }