fix(desktop): disable web security for CORS and fix dev server port

- Set webSecurity: false in BrowserWindow to bypass CORS when
  connecting to remote API (standard Electron practice)
- Fix renderer dev server to port 5173 so localStorage persists
  across restarts (prevents losing login state)
This commit is contained in:
Jiang Bohan
2026-04-10 16:59:50 +08:00
parent 8056c49909
commit 4cca946572
2 changed files with 5 additions and 0 deletions

View File

@@ -11,6 +11,10 @@ export default defineConfig({
plugins: [externalizeDepsPlugin()],
},
renderer: {
server: {
port: 5173,
strictPort: true,
},
plugins: [react(), tailwindcss()],
resolve: {
alias: {

View File

@@ -17,6 +17,7 @@ function createWindow(): void {
webPreferences: {
preload: join(__dirname, "../preload/index.js"),
sandbox: false,
webSecurity: false,
},
});