chg show error messagebox
This commit is contained in:
parent
42a1483225
commit
ec5465f2d2
14
app.ts
14
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="<h1>${e.message}</h1>"`)
|
||||
await dialog.showMessageBox({
|
||||
type: "error",
|
||||
title:"error!",
|
||||
message:e.message,
|
||||
});
|
||||
}
|
||||
else{
|
||||
await wnd.webContents.executeJavaScript(`document.querySelector("body").innerHTML="<h1>${e}</h1>"`)
|
||||
await dialog.showMessageBox({
|
||||
type: "error",
|
||||
title:"error!",
|
||||
message:String(e),
|
||||
});
|
||||
}
|
||||
}
|
||||
wnd.on("closed", () => {
|
||||
|
Loading…
Reference in New Issue
Block a user