app更新优化

This commit is contained in:
wong
2025-08-29 16:56:50 +08:00
parent 1d731c0006
commit 2deb80fdbf

View File

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