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 app() { if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strpos($_SERVER['HTTP_USER_AGENT'], 'iPad')) { $url = ConfigServer::get('app', 'line_ios', ''); } else { $url = ConfigServer::get('app', 'line_android', ''); } if (empty($url)) { echo '未设置app下载链接'; exit; } if (!preg_match("/^http(s)?:\\/\\/.+/", $url)) { $url = "http://".$url; } $this->redirect($url); } public function localReturn(){ $re = $_REQUEST; $data['content'] = $re; $data['dtime'] = date("Y-m-d H:i:s"); Db::name("local_return")->save($data); // if (gettype($re) == "string") { // $data['content'] = $re; // $data['dtime'] = date("Y-m-d H:i:s"); // Db::name("local_return")->save($data); // } else { // $data['content'] = var_export($re, true); // $data['dtime'] = date("Y-m-d H:i:s"); // Db::name("local_return")->save($data); // } } }