msg = $msg; $this->url = $url; $this->wait = $wait; } /** * 错误提示 * */ public function jumpPage(){ $url = $this->url; $msg = $this->msg; $wait = $this->wait; // 处理路径 if ( is_null($url) ) { $url = request()->ajax() ? '' : 'javascript:history.back(-1);'; } elseif ('' !== $url) { $url = (strpos($url, '://') || 0 === strpos($url, '/')) ? $url : url($url); } // 返回结果 return $wait ? response(view('error',['msg'=>$msg,'url'=>$url,'wait'=>$wait])) : redirect($url,302); } }