File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/main/apis/app/uploader Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import uploader from '.'
8
8
import pasteTemplate from '#/utils/pasteTemplate'
9
9
import db from '#/datastore'
10
10
import { handleCopyUrl } from '~/main/utils/common'
11
+ import { handleUrlEncode } from '#/utils/common'
11
12
export const uploadClipboardFiles = async ( ) : Promise < string > => {
12
13
const win = windowManager . getAvailableWindow ( )
13
14
let img = await uploader . setWebContents ( win ! . webContents ) . upload ( )
@@ -28,7 +29,7 @@ export const uploadClipboardFiles = async (): Promise<string> => {
28
29
if ( windowManager . has ( IWindowList . SETTING_WINDOW ) ) {
29
30
windowManager . get ( IWindowList . SETTING_WINDOW ) ! . webContents . send ( 'updateGallery' )
30
31
}
31
- return img [ 0 ] . imgUrl as string
32
+ return handleUrlEncode ( img [ 0 ] . imgUrl as string )
32
33
} else {
33
34
const notification = new Notification ( {
34
35
title : '上传不成功' ,
@@ -60,7 +61,7 @@ export const uploadChoosedFiles = async (webContents: WebContents, files: IFileW
60
61
notification . show ( )
61
62
} , i * 100 )
62
63
db . insert ( 'uploaded' , imgs [ i ] )
63
- result . push ( imgs [ i ] . imgUrl ! )
64
+ result . push ( handleUrlEncode ( imgs [ i ] . imgUrl ! ) )
64
65
}
65
66
handleCopyUrl ( pasteText . join ( '\n' ) )
66
67
windowManager . get ( IWindowList . TRAY_WINDOW ) ! . webContents . send ( 'uploadFiles' , imgs )
You can’t perform that action at this time.
0 commit comments