改进Url生成

This commit is contained in:
thinkphp
2017-07-07 11:31:54 +08:00
parent 49b007f542
commit 4f92dbc170

View File

@@ -67,7 +67,11 @@ class Redirect extends Response
*/
public function getTargetUrl()
{
return strpos($this->data, '://') ? $this->data : Url::build($this->data, $this->params);
if (strpos($this->data, '://') || (strpos($this->data, '/') && empty($this->params))) {
return $this->data;
} else {
return Url::build($this->data, $this->params);
}
}
public function params($params = [])