在控制台打印时中文乱码问题。
问题原因是因为字符编码的问题,Windows下输入chcp,可以查看到当前字符编码,如果大家经历过asp时代的话,就知道:每个asp页面代码的顶部,都必须定义一个数字表示的字符集。而常见的gb2312的值是936,utf8的值是65001
解决办法修改package.json文件
"start": "chcp 65001 && electron-forge start"
Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security
解决方案 在main.js中添加如下代码
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true';
Electron Deprecation Warning (nodeIntegration default change)
解决方案
const createWindow = () => {
// Create the browser window.
mainWindow = new BrowserWindow({
webPreferences: {
nodeIntegration: true,
},
});