feat: support customize baseURL

This commit is contained in:
hronro 2020-12-20 09:49:43 +08:00
parent 3b0cd7bd1e
commit ef17054d99
2 changed files with 2 additions and 2 deletions

View file

@ -13,6 +13,6 @@
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<div id="app"></div>
<div id="app" data-base-url="http://127.0.0.1:9090"></div>
</body>
</html>

View file

@ -160,7 +160,7 @@ export function updateCollapsibleIsOpen(
}
const defaultClashAPIConfig = {
baseURL: 'http://127.0.0.1:9090',
baseURL: document.getElementById('app')?.getAttribute('data-base-url') ?? 'http://127.0.0.1:9090',
secret: '',
addedAt: 0,
};