|
@@ -58,28 +58,10 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
downloadACUrl() {
|
|
downloadACUrl() {
|
|
|
- uni.downloadFile({
|
|
|
|
|
- url: 'https://192.168.166.11/statics/ca.crt', // 替换为 CA 证书地址
|
|
|
|
|
- success: (res) => {
|
|
|
|
|
- if (res.statusCode === 200) {
|
|
|
|
|
- uni.saveFile({
|
|
|
|
|
- tempFilePath: res.tempFilePath,
|
|
|
|
|
- success: (saveRes) => {
|
|
|
|
|
- console.log('证书保存成功', saveRes.savedFilePath);
|
|
|
|
|
- uni.showToast({ title: '下载成功', icon: 'success' });
|
|
|
|
|
- },
|
|
|
|
|
- fail: (err) => {
|
|
|
|
|
- console.error('保存文件失败', err);
|
|
|
|
|
- uni.showToast({ title: '保存失败', icon: 'none' });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- fail: (err) => {
|
|
|
|
|
- console.error('下载失败', err);
|
|
|
|
|
- uni.showToast({ title: '下载失败', icon: 'none' });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ const link = document.createElement('a');
|
|
|
|
|
+ link.href = 'https://192.168.166.11/statics/ca.crt';
|
|
|
|
|
+ link.download = 'ca.crt';
|
|
|
|
|
+ link.click();
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|