mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
简化 traits\think\controller\ajax::result
This commit is contained in:
@@ -27,18 +27,13 @@ trait Ajax
|
||||
*/
|
||||
public function result($data = '', $msg = '', $code = 0, $url = '', $wait = 0)
|
||||
{
|
||||
$result = [
|
||||
return [
|
||||
'code' => $code,
|
||||
'msg' => $msg,
|
||||
'data' => $data,
|
||||
'url' => $url,
|
||||
'wait' => $wait,
|
||||
];
|
||||
if ('html' == Config::get('default_return_type')) {
|
||||
return $this->fetch(Config::get('dispatch_jump_tmpl'), $result);
|
||||
} else {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user