From fb10e430557da4c4b8b7951eace87daf32a09e1a Mon Sep 17 00:00:00 2001 From: wong <106998207@qq.com> Date: Fri, 29 Aug 2025 17:04:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/application/common/controller/Api.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Server/application/common/controller/Api.php b/Server/application/common/controller/Api.php index 1c73576d..e95ca699 100644 --- a/Server/application/common/controller/Api.php +++ b/Server/application/common/controller/Api.php @@ -2,6 +2,7 @@ namespace app\common\controller; +use library\ResponseHelper; use think\Controller; use think\Db; use think\facade\Config; @@ -132,20 +133,19 @@ class Api extends Controller { $type = $this->request->param('type', ''); if (empty($type)){ - return json_encode(['code' => 500,'msg' => '参数缺失']); + return ResponseHelper::error('参数缺失'); } if (!in_array($type,['ckb','ai_store'])){ - return json_encode(['code' => 500,'msg' => '参数错误']); + return ResponseHelper::error('参数错误'); } - + $data = Db::name('app_version') ->field('version,downloadUrl,updateContent') ->where(['type'=>$type]) ->order('id DESC') ->find(); - - return json_encode(['code' => 200,'msg' => '获取成功','data' => $data]); + return ResponseHelper::success($data, '获取成功'); } } \ No newline at end of file