mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-10 00:22:48 +08:00
控制器的error success result redirect方法均不需要使用return
This commit is contained in:
@@ -31,7 +31,7 @@ trait Jump
|
||||
* @param string $url 跳转的URL地址
|
||||
* @param mixed $data 返回的数据
|
||||
* @param integer $wait 跳转等待时间
|
||||
* @return array
|
||||
* @return void
|
||||
*/
|
||||
protected function success($msg = '', $url = null, $data = '', $wait = 3)
|
||||
{
|
||||
@@ -58,7 +58,8 @@ trait Jump
|
||||
$result = ViewTemplate::instance(Config::get('template'), Config::get('view_replace_str'))
|
||||
->fetch(Config::get('dispatch_success_tmpl'), $result);
|
||||
}
|
||||
return Response::create($result, $type);
|
||||
$response = Response::create($result, $type);
|
||||
throw new HttpResponseException($response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,7 +107,7 @@ trait Jump
|
||||
* @param integer $code 返回的code
|
||||
* @param mixed $msg 提示信息
|
||||
* @param string $type 返回数据格式
|
||||
* @return mixed
|
||||
* @return void
|
||||
*/
|
||||
protected function result($data, $code = 0, $msg = '', $type = '')
|
||||
{
|
||||
@@ -117,7 +118,8 @@ trait Jump
|
||||
'data' => $data,
|
||||
];
|
||||
$type = $type ?: $this->getResponseType();
|
||||
return Response::create($result, $type);
|
||||
$response = Response::create($result, $type);
|
||||
throw new HttpResponseException($response);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user