mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
强化success/error方法,支持数据返回
This commit is contained in:
@@ -108,10 +108,10 @@ trait View
|
||||
* @param integer $wait 跳转等待时间
|
||||
* @return void
|
||||
*/
|
||||
protected function error($message, $jumpUrl = '', $wait = 5)
|
||||
protected function error($message, $data = '', $jumpUrl = '', $wait = 5)
|
||||
{
|
||||
$jumpUrl = $jumpUrl ?: 'javascript:history.back(-1);';
|
||||
return $this->result('', $message, 0, $jumpUrl, $wait);
|
||||
return $this->result($data, $message, 0, $jumpUrl, $wait);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,10 +122,10 @@ trait View
|
||||
* @param integer $wait 跳转等待时间
|
||||
* @return void
|
||||
*/
|
||||
protected function success($message, $jumpUrl = '', $wait = 3)
|
||||
protected function success($message, $data = '', $jumpUrl = '', $wait = 3)
|
||||
{
|
||||
$jumpUrl = $jumpUrl ?: $_SERVER["HTTP_REFERER"];
|
||||
return $this->result('', $message, 1, $jumpUrl, $wait);
|
||||
return $this->result($data, $message, 1, $jumpUrl, $wait);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user