refactor: 修改返回类型
This commit is contained in:
@@ -3,7 +3,6 @@ declare (strict_types = 1);
|
|||||||
|
|
||||||
namespace app\admin\controller\v1;
|
namespace app\admin\controller\v1;
|
||||||
|
|
||||||
use apiret\Ret;
|
|
||||||
use app\admin\exception\InvalidLoginException;
|
use app\admin\exception\InvalidLoginException;
|
||||||
use app\admin\model\v1\UserLoginLogModel;
|
use app\admin\model\v1\UserLoginLogModel;
|
||||||
use app\admin\model\v1\UserModel;
|
use app\admin\model\v1\UserModel;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
// 接口错误返回
|
// 接口错误返回
|
||||||
if (!function_exists('error')) {
|
if (!function_exists('error')) {
|
||||||
function error($msg = '', $data = []): \think\Response
|
function error($msg = '', $data = []): \think\response\Json
|
||||||
{
|
{
|
||||||
return \apiret\Api::error($msg, $data);
|
return \apiret\Api::error($msg, $data);
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,7 @@ if (!function_exists('error')) {
|
|||||||
|
|
||||||
// 接口成功返回
|
// 接口成功返回
|
||||||
if (!function_exists('success')) {
|
if (!function_exists('success')) {
|
||||||
function success($msg = '', $data = []): \think\Response
|
function success($msg = '', $data = []): \think\response\Json
|
||||||
{
|
{
|
||||||
return \apiret\Api::success($msg, $data);
|
return \apiret\Api::success($msg, $data);
|
||||||
}
|
}
|
||||||
@@ -20,7 +20,7 @@ if (!function_exists('success')) {
|
|||||||
|
|
||||||
// 接口调结果返回
|
// 接口调结果返回
|
||||||
if (!function_exists('result')) {
|
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);
|
return \apiret\Api::result($errno)->message($msg)->response($data);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user