Javascript 电子能';我没有收到通知

Javascript 电子能';我没有收到通知,javascript,electron,Javascript,Electron,我试图继续学习教程,但在学习之后,我无法收到作为教程最终结果的通知 这是我写的代码: const electron=require('electron'); const path=require('path'); const BrowserWindow=electron.remote.BrowserWindow; const axios=require('axios'); 常数ipc=electron.ipc; const notifyBtn=document.getElementById('n

我试图继续学习教程,但在学习之后,我无法收到作为教程最终结果的通知

这是我写的代码:

const electron=require('electron');
const path=require('path');
const BrowserWindow=electron.remote.BrowserWindow;
const axios=require('axios');
常数ipc=electron.ipc;
const notifyBtn=document.getElementById('notifyBtn');
让price=document.querySelector('h1');
设targetPrice=document.getElementById('targetPrice');
让targetPriceVal;
常量通知={
标题:“BTC警报”,
正文:“BTC刚刚超过你的目标价格!”
};
函数getBTC(){
axios.get()https://min-api.cryptocompare.com/data/pricemulti?fsyms=BTC&tsyms=USD')
。然后(res=>{
const cryptos=res.data.BTC.USD;
price.innerHTML='$'+cryptos.toLocaleString('en');
如果(targetPrice.innerHTML!=''&&targetPriceVal
我想要的期望是:当响应结果超过我的目标值时,我将收到通知

我试过使用
console.log()
,效果很好。但没有通知


我试图更改
新窗口。通知(…)
新通知(…)
相同,但在您链接的教程中,它们显示了
新窗口。通知(…)
但您执行了
新通知(…)
,这会有所不同吗?两者都不起作用。-请参阅开发模式的注意事项电子通知是特定于操作系统的,您正在使用哪个操作系统?@junvar我正在使用windows 10 64b在您链接的教程中,它们显示
新窗口。通知(…)
,但如果您使用
新通知(…)
,这会有区别吗?它们都不工作。-请参阅开发模式的注意事项电子通知是特定于操作系统的,您正在使用哪个操作系统?@junvar我正在使用windows 10 64位