检查更新 POST
比较客户端版本号与服务器最新版本,如有更新则返回更新信息和下载地址。请求方法: POST Content-Type: application/x-www-form-urlencoded
SDK 调用示例
PythonNode.jsJavaC#PHPpython
result = verify.check_update('1000')
if result['success'] and result.get('has_update'):
print(f"最新版本: {result['ver']}")
print(f"下载地址: {result.get('upurl', '')}")
javascript
const result = await verify.checkUpdate('1000');
if (result.success && result.has_update) {
console.log(`最新版本: ${result.ver}`);
}
java
T3Verify.T3Result result = verify.checkUpdate("1000");
if (result.success) System.out.println(result.msg);
csharp
var result = verify.CheckUpdate("1000");
if (result.Success) Console.WriteLine(result.Msg);
php
$result = $verify->checkUpdate('1000');
if ($result['success']) echo $result['msg'] . "\n";
请求参数
成功响应
JSON 格式(需要更新)文本格式(需要更新)jsonc
{
"code": "200", // 状态码
"ver": "v2.0", // 最新版本显示名
"version": "2.0.0", // 最新版本号(用于比较)
"uplog": "1. 修复了已知 bug\n2. 新增用户中心", // 更新公告
"upurl": "https://example.com/download/v2.0.apk" // 更新下载地址
}
txt
需要更新
最新版本:v2.0
最新版本号:2.0.0
更新公告:1. 修复了已知 bug
更新地址:https://example.com/download/v2.0.apk
已是最新版如果客户端版本号与后台设置一致,将返回 code: "201" 和 msg: "已是最新版"。
错误列表