From 1d731c00061bfedd0399aa59f5341c14792e2819 Mon Sep 17 00:00:00 2001 From: wong <106998207@qq.com> Date: Fri, 29 Aug 2025 16:46:47 +0800 Subject: [PATCH] =?UTF-8?q?app=E6=9B=B4=E6=96=B0=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server/application/common/config/route.php | 7 +++++-- Server/application/common/controller/Api.php | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Server/application/common/config/route.php b/Server/application/common/config/route.php index 8b133a1a..8c6ccc6b 100644 --- a/Server/application/common/config/route.php +++ b/Server/application/common/config/route.php @@ -9,7 +9,7 @@ Route::group('v1/auth', function () { Route::post('login', 'app\common\controller\PasswordLoginController@index'); // 账号密码登录 Route::post('mobile-login', 'app\common\controller\Auth@mobileLogin'); // 手机号验证码登录 Route::post('code', 'app\common\controller\Auth@SendCodeController'); // 发送验证码 - + // 需要JWT认证的接口 Route::get('info', 'app\common\controller\Auth@info')->middleware(['jwt']); // 获取用户信息 Route::post('refresh', 'app\common\controller\Auth@refresh')->middleware(['jwt']); // 刷新令牌 @@ -19,4 +19,7 @@ Route::group('v1/auth', function () { Route::group('v1/', function () { Route::post('attachment/upload', 'app\common\controller\Attachment@upload'); // 上传附件 Route::get('attachment/:id', 'app\common\controller\Attachment@info'); // 获取附件信息 -})->middleware(['jwt']); \ No newline at end of file +})->middleware(['jwt']); + + +Route::get('app/update', 'app\common\controller\Api@uploadApp'); \ No newline at end of file diff --git a/Server/application/common/controller/Api.php b/Server/application/common/controller/Api.php index 5a554eff..42eb2eb6 100644 --- a/Server/application/common/controller/Api.php +++ b/Server/application/common/controller/Api.php @@ -125,4 +125,20 @@ class Api extends Controller $response->send(); exit; } + + + public function uploadApp() + { + $type = $this->request->param('type', ''); + 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. 新增了某某功能" + ]; + return json_encode(['code' => 200,'msg' => '获取成功','data' => $data]); + + } } \ No newline at end of file