Fix getObjectByLocation (zoom download issue)
This commit is contained in:
parent
8a2bd2c465
commit
a16f9e1c80
@ -906,22 +906,10 @@ export function getObjectByLocation(location: Location) {
|
||||
|
||||
try {
|
||||
const searchUrl = location.search.substring(1);
|
||||
const decodedString = decodeURIComponent(searchUrl)
|
||||
.replace(/\["/g, '["')
|
||||
.replace(/"\]/g, '"]')
|
||||
.replace(/"/g, '\\"')
|
||||
.replace(/&/g, '","')
|
||||
.replace(/=/g, '":"')
|
||||
.replace(/\\/g, "\\\\")
|
||||
.replace(/\[\\\\"/g, '["')
|
||||
.replace(/\\\\"\]/g, '"]')
|
||||
.replace(/"\[/g, "[")
|
||||
.replace(/\]"/g, "]")
|
||||
.replace(/\\\\",\\\\"/g, '","')
|
||||
.replace(/\\\\\\\\"/g, '\\"');
|
||||
const object = JSON.parse(`{"${decodedString}"}`);
|
||||
return object;
|
||||
const params = Object.fromEntries(new URLSearchParams(searchUrl));
|
||||
return params;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
21
public/thirdparty/third-party.html
vendored
21
public/thirdparty/third-party.html
vendored
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
@ -49,19 +49,14 @@
|
||||
function getObjectByLocation(location) {
|
||||
if (!location.search || !location.search.length) return null;
|
||||
|
||||
try {
|
||||
const searchUrl = location.search.substring(1);
|
||||
const object = JSON.parse(
|
||||
'{"' +
|
||||
decodeURIComponent(
|
||||
searchUrl
|
||||
.replace(/"/g, '\\"')
|
||||
.replace(/&/g, '","')
|
||||
.replace(/=/g, '":"')
|
||||
) +
|
||||
'"}'
|
||||
);
|
||||
|
||||
return object;
|
||||
const params = Object.fromEntries(new URLSearchParams(searchUrl));
|
||||
return params;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
function renderError(error) {
|
||||
|
Loading…
Reference in New Issue
Block a user