mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 07:06:00 +00:00
#91 authorization header in electron app
This commit is contained in:
@@ -20,3 +20,16 @@ export default function resolveApi() {
|
||||
}
|
||||
return window.location.origin;
|
||||
}
|
||||
|
||||
export function resolveApiHeaders() {
|
||||
if (window['require']) {
|
||||
const electron = window['require']('electron');
|
||||
|
||||
if (electron) {
|
||||
return {
|
||||
Authorization: electron.remote.getGlobal('authorization'),
|
||||
};
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user