优化后台页面刷新跳转

pull/495/MERGE
Karson 2025-05-20 15:26:40 +08:00
parent 9e3f10cf75
commit 26159a2095
1 changed files with 7 additions and 11 deletions

View File

@ -222,16 +222,12 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
//如果是刷新操作则直接返回刷新前的页面
if (Config.referer) {
if (Config.referer === $(addtabs).attr("url")) {
var active = $("ul.sidebar-menu li a[addtabs=" + $(addtabs).attr("addtabs") + "]");
if (multiplenav && active.length == 0) {
active = $("ul li a[addtabs='" + $(addtabs).attr("addtabs") + "']");
var active = $("ul.sidebar-menu li a[url='" + Config.referer + "']");
if (multiplenav && active.length === 0) {
active = $("ul li a[url='" + Config.referer + "']");
}
if (active.length > 0) {
active.trigger("click");
} else {
$(addtabs).appendTo(document.body).addClass("hide").trigger("click");
}
} else {
//刷新页面后跳到到刷新前的页面
Backend.api.addtabs(Config.referer);
@ -333,7 +329,7 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'adminlte', 'form'], functi
// 切换菜单栏
$(document).on("click", ".sidebar-toggle", function () {
setTimeout(function(){
setTimeout(function () {
var value = $("body").hasClass("sidebar-collapse") ? 1 : 0;
setTimeout(function () {
$(window).trigger("resize");