mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 15:12:48 +08:00
response类增加create方法 改进think\response\redirect类 改进助手函数和traits\controller\Jump
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
namespace think\controller;
|
||||
|
||||
use think\Response;
|
||||
use think\response\Json;
|
||||
|
||||
abstract class Rest
|
||||
{
|
||||
@@ -93,11 +92,7 @@ abstract class Rest
|
||||
*/
|
||||
protected function response($data, $type = 'json', $code = 200)
|
||||
{
|
||||
if('json'==$type){
|
||||
return (new Json($data))->code($code);
|
||||
}else{
|
||||
return (new Response($data,$type))->code($code);
|
||||
}
|
||||
return Response::create($data, $type)->code($code);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user