diff options
| author | Haishan <[email protected]> | 2020-12-22 12:28:59 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-12-22 12:28:59 +0800 |
| commit | c4150a4edfdd24f750c31d641540625b5e625fbf (patch) | |
| tree | 86ec7ade2ae465f97c93cf18b4ccfb3849db5150 /src | |
| parent | 3b0cd7bd1e12cb10e53810acd5d983e735bd78c7 (diff) | |
| parent | ef17054d9930b74bed5a38b17ad67582fd7cbe7b (diff) | |
Merge pull request #550 from foisonocean/support-customize-baseurl
feat: support customize baseURL
Diffstat (limited to 'src')
| -rw-r--r-- | src/index.template.ejs | 2 | ||||
| -rw-r--r-- | src/store/app.ts | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/index.template.ejs b/src/index.template.ejs index 22b2abc..5fbc28b 100644 --- a/src/index.template.ejs +++ b/src/index.template.ejs @@ -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> diff --git a/src/store/app.ts b/src/store/app.ts index 4c7a796..d1daeeb 100644 --- a/src/store/app.ts +++ b/src/store/app.ts @@ -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, }; |
