在导航栏中切换到路由器后,当我启动下载进程electron-dl,electron-download-manager时,会出现循环

li9yvcax  于 2023-03-16  发布在  Electron
关注(0)|答案(2)|浏览(203)

在导航栏中与路由器切换后,当我开始下载过程时,我会得到一个循环。
我怎么能解决这个问题呢?我已经两天没做了,我不能解决

function downloaddosya1() {
  console.log("Files1 downloading...")
  const url = "http://ipv4.download.thinkbroadband.com/100MB.zip"
  ipcRenderer.invoke("downloadmng",url);
}
// DOSYA 1
function checkdosya() {
const yereldosya = 'C:\\test\\xampp-control.exe'
const yereldosyahash ='ed4d6fdb6248bcff64e5652cd0c9d79c483bace94c1120dc3128645f00a5e5c4'
fs.exists(yereldosya, function(exists) { 
  if (exists) { 
    console.log("Dosya Var")
getChecksum(yereldosya)
.then(checksum => { apidosya(checksum) })
.catch(err => console.log(err));
const apidosya = async(checksum) => {
  if(checksum == yereldosyahash){
      checkdosyadone()
}else{
  console.log("Files 1 False")
  downloaddosya1()
}
}
}else{
    console.log("Dosya Yok")
    downloaddosya1()
  }
});
}
s1ag04yj

s1ag04yj1#

<div class="topPanel"><div id="panel"></div>
    <router-link to="Dashboard" class="topPanelItem textMenu" active-class="activeMenu">Home</router-link>
    <router-link to="Store" class="topPanelItem textMenu" active-class="activeMenu">Store</router-link>
    <div @click="checkdosya()" to="Play" id="logoBN" class="playButton">Play</div>
    <router-link to="News" class="topPanelItem textMenu" active-class="activeMenu">News</router-link>
    <div  @click="CreateAcc()" class="topPanelItem textMenu">Support</div>
    <div  @click="CreateAcc()" class="topPanelItem textMenu2">Forum</div>
    <div  @click="downloadmng()" class="topPanelItem textMenu2">Discord</div>
  </div>

https://cdn.discordapp.com/attachments/800760836217765888/1085288422995922994/dsada.txt
我不能共享其他代码我共享文件

ipcMain.handle("downloadmng",(event,url)=>{
  downloader.download({
    url: url,
    onProgress: (progress,item) => {
      event.sender.send("progress",progress);
    }
  },function(error,info){
    event.sender.send("downloadmngtrue");
    event.sender.send("info",info)
  })
xvw2m8pv

xvw2m8pv2#

存在路由问题或主渲染器存在问题
这个主要过程

ipcMain.handle("downloadmng",(event,url)=>{
  downloader.download({
    url: url,
    onProgress: (progress,item) => {
      event.sender.send("progress",progress);
    }

此导航栏

<div class="topPanel"><div id="panel"></div>
    <router-link to="Dashboard" class="topPanelItem textMenu" active-class="activeMenu">Home</router-link>
    <router-link to="Store" class="topPanelItem textMenu" active-class="activeMenu">Store</router-link>
    <div @click="checkdosya()" to="Play" id="logoBN" class="playButton">Play</div>
    <router-link to="News" class="topPanelItem textMenu" active-class="activeMenu">News</router-link>
    <div  @click="CreateAcc()" class="topPanelItem textMenu">Support</div>
    <div  @click="CreateAcc()" class="topPanelItem textMenu2">Forum</div>
    <div  @click="downloadmng()" class="topPanelItem textMenu2">Discord</div>
  </div>

该下载功能

'
const url = "http://ipv4.download.thinkbroadband.com/100MB.zip"
ipcRenderer.invoke("downloadmng",url);

相关问题