切换导航条
切换导航条
当前项目
正在载入...
登录
术习电报
/
electron-vue-template
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
作者
umbrella22
2020-11-27 16:17:23 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
提交
358cb41ca2d4d816dc97d8a61b694daf260a533c
358cb41c
1 个父辈
f14b9c44
更换已废弃的方法
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
3 行增加
和
3 行删除
src/main/services/downloadFile.ts
src/main/services/downloadFile.ts
查看文件 @
358cb41
import
{
app
,
ipcMain
,
BrowserWindow
,
dialog
}
from
'electron'
import
{
join
}
from
'path'
import
{
arch
,
platform
}
from
'os'
import
{
exists
,
remove
}
from
'fs-extra'
import
{
stat
,
remove
}
from
'fs-extra'
import
{
version
}
from
'../../../package.json'
...
...
@@ -33,9 +33,9 @@ class Main {
start
()
{
ipcMain
.
on
(
'satrt-download'
,
(
event
,
msg
)
=>
{
// 更新时检查有无同名文件,若有就删除,若无就开始下载
exists
(
this
.
HistoryFilePath
,
async
(
e
)
=>
{
stat
(
this
.
HistoryFilePath
,
async
(
err
,
stats
)
=>
{
try
{
if
(
e
)
{
if
(
stats
)
{
await
remove
(
this
.
HistoryFilePath
)
}
this
.
mainWindow
.
webContents
.
downloadURL
(
this
.
downloadUrl
)
...
...
请
注册
或
登录
后发表评论