苹果更新弹窗
This commit is contained in:
+24
-24
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user