-
Notifications
You must be signed in to change notification settings - Fork 2
Swagger 中文路径导致浏览历史和收藏夹无效 #9
Copy link
Copy link
Open
Description
建议修改监听hash的逻辑,增加decodeURI解码;
addListeners() {
window.addEventListener("hashchange", () => {
let _path = location.hash.length > 0 ? location.hash.substr(1) : "";
if (!_path) return;
_path = (window.decodeURI && window.decodeURI(_path)) || _path;
const row =
document.getElementById(_path) ||
(document.querySelector(`a[href="#${_path}"]`) &&
document.querySelector(`a[href="#${_path}"]`).closest(".opblock"));
if (row) LinkStore.save(row, "swagger-toolkit-history");
this._updatePane("swagger-toolkit-history");
});
document
.querySelector("#swagger-ui")
.addEventListener("mouseover", (evt) => {
this._showPathBtnGroup(evt); // 显示在 path 栏中的按钮组
});
return this;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels