19 lines
472 B
JavaScript
19 lines
472 B
JavaScript
(function() {
|
|
var routePath = window.__H5_ROUTE_PATH__;
|
|
if (!routePath) {
|
|
return;
|
|
}
|
|
|
|
var currentHash = window.location.hash ? window.location.hash.slice(1) : "";
|
|
if (currentHash === routePath || currentHash.indexOf(routePath + "?") === 0) {
|
|
return;
|
|
}
|
|
|
|
var nextHash = routePath + (window.location.search || "");
|
|
window.history.replaceState(
|
|
null,
|
|
"",
|
|
window.location.pathname + (window.location.search || "") + "#" + nextHash
|
|
);
|
|
})();
|