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 {
|
} else {
|
||||||
const stats = fs.statSync(filePath)
|
const stats = fs.statSync(filePath)
|
||||||
//如果线上时间大于线下时间,就需要从线上下载,否则则需要上传
|
//如果线上时间大于线下时间,就需要从线上下载,否则则需要上传
|
||||||
let time = new Date(lastModifyTime)
|
if (lastModifyTime > stats.mtime.getTime()) {
|
||||||
if (time > stats.mtime.getTime()) {
|
|
||||||
e.reply('is-async-local-file-reply' + fileNewName, { isAsync: true, type: 'down' })
|
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' })
|
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(
|
isAsyncLocalFile(item.fileNewName, item.lastModifyTime, item.fileMd5).then(
|
||||||
({ isAsync, type }) => {
|
({ isAsync, type }) => {
|
||||||
console.log(isAsync, type)
|
|
||||||
item.async = !isAsync
|
item.async = !isAsync
|
||||||
if (isAsync === true) {
|
if (isAsync === true) {
|
||||||
item.async = 'on'
|
item.async = 'on'
|
||||||
|
@ -183,12 +182,9 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (type === 'upload') {
|
if (type === 'upload') {
|
||||||
let cookie = localStorage.getItem('Admin-Token')
|
|
||||||
ipcRenderer.send('upload-file-change', {
|
ipcRenderer.send('upload-file-change', {
|
||||||
id: item.id,
|
url: item.fileFullPath,
|
||||||
fileNewName: item.fileNewName,
|
fileName: item.fileNewName
|
||||||
cookie,
|
|
||||||
fileType: item.fileType
|
|
||||||
})
|
})
|
||||||
ipcRenderer.once(
|
ipcRenderer.once(
|
||||||
'upload-file-change-success' + item.fileNewName,
|
'upload-file-change-success' + item.fileNewName,
|
||||||
|
|
Loading…
Reference in New Issue