优化:在线更新时忽略https证书(避免老设备证书验证失败)

This commit is contained in:
pppscn 2024-04-27 18:57:48 +08:00
parent 894155df22
commit 4e8d8283c2
1 changed files with 3 additions and 0 deletions

View File

@ -26,6 +26,7 @@ class XHttpUpdateHttpServiceImpl : IUpdateHttpService {
callBack: IUpdateHttpService.Callback,
) {
XHttp.get(url)
.ignoreHttpsCert()
.params(params)
.keepJson(true)
.execute(object : SimpleCallBack<String>() {
@ -46,6 +47,7 @@ class XHttpUpdateHttpServiceImpl : IUpdateHttpService {
callBack: IUpdateHttpService.Callback,
) {
XHttp.post(url)
.ignoreHttpsCert()
.upJson(JsonUtil.toJson(params))
.keepJson(true)
.execute(object : SimpleCallBack<String>() {
@ -63,6 +65,7 @@ class XHttpUpdateHttpServiceImpl : IUpdateHttpService {
override fun download(url: String, path: String, fileName: String, callback: DownloadCallback) {
XHttpSDK.addRequest(
url, XHttp.downLoad(url)
.ignoreHttpsCert()
.savePath(path)
.saveName(fileName)
.isUseBaseUrl(false)