refactor: 修改返回类型

This commit is contained in:
2025-01-04 10:40:49 +08:00
parent 47f4b61542
commit 267ca1f76f
2 changed files with 3 additions and 4 deletions

View File

@@ -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;

View File

@@ -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);
} }