后台管理
This commit is contained in:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user