refactor: 修改返回类型
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
// 接口错误返回
|
||||
if (!function_exists('error')) {
|
||||
function error($msg = '', $data = []): \think\Response
|
||||
function error($msg = '', $data = []): \think\response\Json
|
||||
{
|
||||
return \apiret\Api::error($msg, $data);
|
||||
}
|
||||
@@ -12,7 +12,7 @@ if (!function_exists('error')) {
|
||||
|
||||
// 接口成功返回
|
||||
if (!function_exists('success')) {
|
||||
function success($msg = '', $data = []): \think\Response
|
||||
function success($msg = '', $data = []): \think\response\Json
|
||||
{
|
||||
return \apiret\Api::success($msg, $data);
|
||||
}
|
||||
@@ -20,7 +20,7 @@ if (!function_exists('success')) {
|
||||
|
||||
// 接口调结果返回
|
||||
if (!function_exists('result')) {
|
||||
function result($errno, $msg = '', $data = []): \think\Response
|
||||
function result($errno, $msg = '', $data = []): \think\response\Json
|
||||
{
|
||||
return \apiret\Api::result($errno)->message($msg)->response($data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user