response类增加create方法 改进think\response\redirect类 改进助手函数和traits\controller\Jump

This commit is contained in:
thinkphp
2016-05-17 11:17:24 +08:00
parent df96d049b9
commit 92d999b484
6 changed files with 73 additions and 76 deletions

View File

@@ -30,10 +30,11 @@ class Redirect extends Response
*/
protected function output($data)
{
$this->isExit = true;
$url = preg_match('/^(https?:|\/)/', $data) ? $data : Url::build($data, $this->params);
$this->header['Location'] = $url;
$this->header['status'] = isset($this->header['status']) ? $this->header['status'] : 301;
$this->isExit = true;
$url = preg_match('/^(https?:|\/)/', $data) ? $data : Url::build($data, $this->params);
$this->header['Location'] = $url;
$this->header['status'] = isset($this->header['status']) ? $this->header['status'] : 301;
$this->header['Cache-control'] = 'no-cache,must-revalidate';
return;
}