diff --git a/app.ts b/app.ts index 88cb337..b1a9d4d 100644 --- a/app.ts +++ b/app.ts @@ -1,4 +1,4 @@ -import { app, BrowserWindow, session } from "electron"; +import { app, BrowserWindow, session, dialog } from "electron"; import { get_setting } from "./src/setting"; import { create_server, start_server } from "./src/server"; import { getAdminAccessTokenValue,getAdminRefreshTokenValue, accessTokenName, refreshTokenName } from "./src/login"; @@ -39,10 +39,18 @@ if (!setting.cli) { } catch(e){ if(e instanceof Error){ - await wnd.webContents.executeJavaScript(`document.querySelector("body").innerHTML="

${e.message}

"`) + await dialog.showMessageBox({ + type: "error", + title:"error!", + message:e.message, + }); } else{ - await wnd.webContents.executeJavaScript(`document.querySelector("body").innerHTML="

${e}

"`) + await dialog.showMessageBox({ + type: "error", + title:"error!", + message:String(e), + }); } } wnd.on("closed", () => {