mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-24 09:45:35 +08:00
fix: auto configure (#726)
This commit is contained in:
parent
14215e20e5
commit
ce4f67d650
@ -108,11 +108,21 @@ export default () => {
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
const query = new URLSearchParams(location.search)
|
||||
let search = location.search
|
||||
|
||||
if (search.length === 0) {
|
||||
const searchList = location.hash.match(/\?.*$/)
|
||||
|
||||
if (searchList.length > 0 && searchList[0].length > 0) {
|
||||
search = searchList[0].replace('?', '', 1)
|
||||
}
|
||||
}
|
||||
|
||||
const query = new URLSearchParams(search)
|
||||
|
||||
if (query.has('hostname')) {
|
||||
void onSubmit({
|
||||
url: `${window.location.protocol}//${query.get('hostname')}${
|
||||
url: `${query.get('http') ? 'http:' : query.get('https') ? 'https:' : window.location.protocol}//${query.get('hostname')}${
|
||||
query.get('port') ? `:${query.get('port')}` : ''
|
||||
}`,
|
||||
secret: query.get('secret') ?? '',
|
||||
|
Loading…
Reference in New Issue
Block a user