From 2deb80fdbfe9414f937d386e3a2e956025fe7da6 Mon Sep 17 00:00:00 2001 From: wong <106998207@qq.com> Date: Fri, 29 Aug 2025 16:56:50 +0800 Subject: [PATCH] =?UTF-8?q?app=E6=9B=B4=E6=96=B0=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 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Server/application/common/controller/Api.php b/Server/application/common/controller/Api.php index 42eb2eb6..1c73576d 100644 --- a/Server/application/common/controller/Api.php +++ b/Server/application/common/controller/Api.php @@ -3,6 +3,7 @@ namespace app\common\controller; use think\Controller; +use think\Db; use think\facade\Config; use think\facade\Request; use think\facade\Response; @@ -133,11 +134,17 @@ class Api extends Controller if (empty($type)){ return json_encode(['code' => 500,'msg' => '参数缺失']); } - $data = [ - "version" => "1.1.0", - "downloadUrl"=> "http://kr-phone.quwanzhi.com/ckb.apk", - "updateContent"=> "1. 修复了已知问题\n2. 优化了用户体验\n3. 新增了某某功能" - ]; + + if (!in_array($type,['ckb','ai_store'])){ + return json_encode(['code' => 500,'msg' => '参数错误']); + } + + $data = Db::name('app_version') + ->field('version,downloadUrl,updateContent') + ->where(['type'=>$type]) + ->order('id DESC') + ->find(); + return json_encode(['code' => 200,'msg' => '获取成功','data' => $data]); }