新增Jump相关测试用例

This commit is contained in:
Gaozhen Ying
2017-09-08 17:18:55 +08:00
committed by ThinkPHP
parent f3a47f30ff
commit 60d6be4627
4 changed files with 342 additions and 7 deletions

View File

@@ -36,8 +36,8 @@ trait Jump
*/
protected function success($msg = '', $url = null, $data = '', $wait = 3, array $header = [])
{
if (is_null($url) && isset($_SERVER["HTTP_REFERER"])) {
$url = $_SERVER["HTTP_REFERER"];
if (is_null($url) && !is_null(Request::instance()->server('HTTP_REFERER'))) {
$url = Request::instance()->server('HTTP_REFERER');
} elseif ('' !== $url) {
$url = (strpos($url, '://') || 0 === strpos($url, '/')) ? $url : Url::build($url);
}
@@ -107,7 +107,7 @@ trait Jump
$result = [
'code' => $code,
'msg' => $msg,
'time' => $_SERVER['REQUEST_TIME'],
'time' => Request::instance()->server('REQUEST_TIME'),
'data' => $data,
];
$type = $type ?: $this->getResponseType();