解决思路:
- localhost:3000本地react项目确保运行无误
- electron 官方demo跑一遍确认不是配置问题
- 切换electron版本,发现5可以6不行
方案一:
- 安装.NET Framework 4.7.1window修复更新
方案二:
// 参考链接: https://stackoverflow.com/questions/42524606/how-to-get-windows-version-using-node-js
const os = require('os')
const isWin7 = os.release().startsWith('6.1')
// win7 下关闭硬件加速
if (isWin7) app.disableHardwareAcceleration()