diff --git a/src/main/file.js b/src/main/file.js index d3eede2..348c703 100644 --- a/src/main/file.js +++ b/src/main/file.js @@ -146,7 +146,7 @@ export default async function ({ app, shell, BrowserWindow, ipcMain }) { //使用默认应用打开本地文件 ipcMain.on('open-path-app', (e, destination) => { let path = appRootFilePath + destination - shell.openExternal(path).catch((error) => { + shell.openPath(path).catch((error) => { console.log(error) }) }) diff --git a/src/main/index.js b/src/main/index.js index d5e6f75..c90837e 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -28,6 +28,7 @@ function createLoginWindow() { icon: join(__dirname, '../../resources/logo2.ico'), ...(process.platform === 'linux' ? { icon } : {}), webPreferences: { + defaultEncoding: 'utf-8', preload: join(__dirname, '../preload/index.js'), sandbox: false, nodeIntegration: true, @@ -67,6 +68,7 @@ function createMainWindow() { icon: join(__dirname, '../../resources/logo2.ico'), ...(process.platform === 'linux' ? { icon } : {}), webPreferences: { + defaultEncoding: 'utf-8', preload: join(__dirname, '../preload/index.js'), sandbox: false, // nodeIntegration: true, @@ -115,6 +117,7 @@ async function createLinkWin(data) { autoHideMenuBar: true, ...(process.platform === 'linux' ? { icon } : {}), webPreferences: { + defaultEncoding: 'utf-8', sandbox: false, nodeIntegration: true, worldSafeExecuteJavaScript: true, @@ -143,6 +146,8 @@ async function createLinkWin(data) { // 初始化完成 app.on('ready', () => { + process.env.LANG = 'en_US.UTF-8' + process.env['ELECTRON_DISABLE_SANDBOX'] = true; // 设置应用程序用户模型标识符 electronApp.setAppUserModelId('com.electron') diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index bdd14b9..9c02172 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -42,7 +42,7 @@