fix: Browser mode 404 error for meeting-detail page

- Preserve query parameters (e.g., ?id=123) when opening in browser
- Add packaged mode detection for CLIENT_DIR path resolution
- Include client files in extraResources for backend to serve
- Add debug logging for client directory detection

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
egg
2025-12-22 17:50:14 +08:00
parent 7d3fc72bd2
commit 771655e03e
3 changed files with 45 additions and 2 deletions

View File

@@ -41,6 +41,26 @@
{
"from": "config.json",
"to": "config.json"
},
{
"from": "src/pages",
"to": "backend/client/pages",
"filter": ["**/*"]
},
{
"from": "src/styles",
"to": "backend/client/styles",
"filter": ["**/*"]
},
{
"from": "src/services",
"to": "backend/client/services",
"filter": ["**/*"]
},
{
"from": "src/config",
"to": "backend/client/config",
"filter": ["**/*"]
}
],
"win": {

View File

@@ -734,10 +734,19 @@ ipcMain.handle("open-in-browser", async () => {
const host = backendConfig.host || "127.0.0.1";
const port = backendConfig.port || 8000;
// Determine the current page URL
// Determine the current page URL and preserve query parameters
let currentPage = "login";
let queryString = "";
if (mainWindow) {
const currentUrl = mainWindow.webContents.getURL();
// Parse query string from current URL (e.g., ?id=123)
const urlMatch = currentUrl.match(/\?(.+)$/);
if (urlMatch) {
queryString = "?" + urlMatch[1];
}
if (currentUrl.includes("meetings.html")) {
currentPage = "meetings";
} else if (currentUrl.includes("meeting-detail.html")) {
@@ -745,7 +754,7 @@ ipcMain.handle("open-in-browser", async () => {
}
}
const browserUrl = `http://${host}:${port}/${currentPage}`;
const browserUrl = `http://${host}:${port}/${currentPage}${queryString}`;
try {
await shell.openExternal(browserUrl);