Merge pull request #550 from foisonocean/support-customize-baseurl

feat: support customize baseURL
This commit is contained in:
Haishan 2020-12-22 12:28:59 +08:00 committed by GitHub
commit c4150a4edf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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,
};