苹果更新弹窗

This commit is contained in:
2025-07-22 10:45:29 +08:00
parent cecc98b70e
commit 0ee4ec3ca9
5 changed files with 89 additions and 66 deletions
+24 -24
View File
@@ -133,31 +133,31 @@ export const queryCurrentUser = (data) => request({
// 生成唯一文件名,避免冲突
const filename = pathName.split('/').pop()
const localFilePath = '_downloads/' + filename
console.log('localFilePath', localFilePath, url);
// 先检查是否存在
// uni.getFileInfo({
// filePath: localFilePath,
// success: () => {
// console.log('头像已存在,无需下载');
// updateUserAvatar(localFilePath)
// },
// fail: () => {
// console.log('开始下载头像:', url);
// const dtask = plus.downloader.createDownload(
// url, {
// method: 'GET',
// filename: '_downloads/' + filename
// },
// (download, status) => {
// if (status === 200) {
// console.log('头像下载成功:', download.filename);
// updateUserAvatar(download.filename)
// }
// }
// )
// dtask.start();
// }
// })
uni.getFileInfo({
filePath: localFilePath,
success: () => {
console.log('头像已存在,无需下载');
updateUserAvatar(localFilePath)
},
fail: () => {
console.log('开始下载头像:', url);
const dtask = plus.downloader.createDownload(
url, {
method: 'GET',
filename: '_downloads/' + filename
},
(download, status) => {
if (status === 200) {
console.log('头像下载成功:', download.filename);
updateUserAvatar(download.filename)
}
}
)
dtask.start();
}
})
} catch (error) {