后台管理

This commit is contained in:
2025-12-12 10:14:28 +08:00
parent 43250334a2
commit 238594fdcf
3 changed files with 22 additions and 4 deletions

View File

@ -436,6 +436,18 @@ function createWindow(): void {
// 1. 创建独立临时会话
const tempSession = createTempSession();
try {
if (option && option.Authorization) {
tempSession.webRequest.onBeforeSendHeaders((details, callback) => {
const headers = Object.assign({}, details.requestHeaders);
headers['Authorization'] = option.Authorization;
callback({ requestHeaders: headers });
});
}
} catch (e) {
console.error('注入认证头失败:', e);
}
// 2. 合并窗口配置:注入独立会话
const windowConfig = {
...params,