mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-08-03 12:18:22 +08:00
Updated: electron version & fixed smms pic type
This commit is contained in:
@@ -354,6 +354,9 @@ const uploadClipboardFiles = async () => {
|
||||
notification.show()
|
||||
window.webContents.send('clipboardFiles', [])
|
||||
window.webContents.send('uploadFiles', img)
|
||||
if (settingWindow) {
|
||||
settingWindow.webContents.send('updateGallery')
|
||||
}
|
||||
} else {
|
||||
const notification = new Notification({
|
||||
title: '上传不成功',
|
||||
@@ -396,6 +399,9 @@ ipcMain.on('uploadClipboardFiles', async (evt, file) => {
|
||||
notification.show()
|
||||
window.webContents.send('clipboardFiles', [])
|
||||
window.webContents.send('uploadFiles', img)
|
||||
if (settingWindow) {
|
||||
settingWindow.webContents.send('updateGallery')
|
||||
}
|
||||
} else {
|
||||
uploadFailed()
|
||||
}
|
||||
@@ -423,6 +429,9 @@ ipcMain.on('uploadChoosedFiles', async (evt, files) => {
|
||||
}
|
||||
clipboard.writeText(pasteText)
|
||||
window.webContents.send('uploadFiles', imgs)
|
||||
if (settingWindow) {
|
||||
settingWindow.webContents.send('updateGallery')
|
||||
}
|
||||
} else {
|
||||
uploadFailed()
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ const smmsUpload = async function (img, type, webContents) {
|
||||
if (body.code === 'success') {
|
||||
delete imgList[i].base64Image
|
||||
imgList[i]['imgUrl'] = body.data.url
|
||||
imgList[i]['type'] = 'smms'
|
||||
} else {
|
||||
webContents.send('uploadProgress', -1)
|
||||
return new Error()
|
||||
|
||||
Reference in New Issue
Block a user