Skip to content

Instantly share code, notes, and snippets.

@pandada8
Created May 9, 2020 13:50
Show Gist options
  • Save pandada8/392e58ea273116c15f83c307c2b9f479 to your computer and use it in GitHub Desktop.
Save pandada8/392e58ea273116c15f83c307c2b9f479 to your computer and use it in GitHub Desktop.
patch clash-dashboard without auto location detection
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