Created
May 9, 2020 13:50
-
-
Save pandada8/392e58ea273116c15f83c307c2b9f479 to your computer and use it in GitHub Desktop.
patch clash-dashboard without auto location detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/lib/request.ts b/src/lib/request.ts | |
index 9a8b3e8..52fd7b2 100644 | |
--- a/src/lib/request.ts | |
+++ b/src/lib/request.ts | |
@@ -110,14 +110,9 @@ export async function getExternalControllerConfig () { | |
} | |
export const getInstance = createAsyncSingleton(async () => { | |
- const { | |
- hostname, | |
- port, | |
- secret | |
- } = await getExternalControllerConfig() | |
- | |
+ const { secret } = await getExternalControllerConfig() | |
return axios.create({ | |
- baseURL: `//${hostname}:${port}`, | |
+ baseURL: '//' + location.host, | |
headers: secret ? { Authorization: `Bearer ${secret}` } : {} | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment