Compare commits
No commits in common. "ac5cafe1e8d373f0cf60424b1236158ef1a10266" and "0086ce423603a9b95cb313efb17de778cb72a1f1" have entirely different histories.
ac5cafe1e8
...
0086ce4236
|
@ -127,10 +127,9 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) {
|
|||
} else {
|
||||
const stats = fs.statSync(filePath)
|
||||
//如果线上时间大于线下时间,就需要从线上下载,否则则需要上传
|
||||
let time = new Date(lastModifyTime)
|
||||
if (time > stats.mtime.getTime()) {
|
||||
if (lastModifyTime > stats.mtime.getTime()) {
|
||||
e.reply('is-async-local-file-reply' + fileNewName, { isAsync: true, type: 'down' })
|
||||
} else if (time < stats.mtime.getTime()) {
|
||||
} else if (lastModifyTime < stats.mtime.getTime()) {
|
||||
e.reply('is-async-local-file-reply' + fileNewName, { isAsync: true, type: 'upload' })
|
||||
}
|
||||
}
|
||||
|
|
|
@ -168,7 +168,6 @@ export default {
|
|||
//判断是否需要从线上拿新的文件
|
||||
isAsyncLocalFile(item.fileNewName, item.lastModifyTime, item.fileMd5).then(
|
||||
({ isAsync, type }) => {
|
||||
console.log(isAsync, type)
|
||||
item.async = !isAsync
|
||||
if (isAsync === true) {
|
||||
item.async = 'on'
|
||||
|
@ -183,12 +182,9 @@ export default {
|
|||
})
|
||||
}
|
||||
if (type === 'upload') {
|
||||
let cookie = localStorage.getItem('Admin-Token')
|
||||
ipcRenderer.send('upload-file-change', {
|
||||
id: item.id,
|
||||
fileNewName: item.fileNewName,
|
||||
cookie,
|
||||
fileType: item.fileType
|
||||
url: item.fileFullPath,
|
||||
fileName: item.fileNewName
|
||||
})
|
||||
ipcRenderer.once(
|
||||
'upload-file-change-success' + item.fileNewName,
|
||||
|
|
Loading…
Reference in New Issue