自动检测/手动检测页面

This commit is contained in:
zhujiyan
2024-10-10 17:47:55 +08:00
parent 507ea137e4
commit e060939bc1
30 changed files with 3176 additions and 116 deletions

View File

@@ -6,8 +6,8 @@ import {
getShowMenuList,
getAllBreadcrumbList,
} from "@/utils";
import { useRouter } from "vue-router";
import { AUTH_STORE_KEY } from "@/stores/constant";
export const useAuthStore = defineStore({
id: AUTH_STORE_KEY,
state: (): AuthState => ({
@@ -19,6 +19,7 @@ export const useAuthStore = defineStore({
routeName: "",
//登录不显示菜单栏和导航栏,点击进入测试的时候显示
showMenuFlag: JSON.parse(localStorage.getItem("showMenuFlag")),
router: useRouter(),
}),
getters: {
// 按钮权限列表
@@ -51,22 +52,23 @@ export const useAuthStore = defineStore({
},
//重置权限
async resetAuthStore() {
this.showMenuFlag=false;
this.showMenuFlag = false;
localStorage.removeItem("showMenuFlag");
},
//修改判断菜单栏/导航栏显示条件
async setShowMenu() {
this.showMenuFlag = true;
localStorage.setItem("showMenuFlag", true);
this.showMenuFlag = true;
localStorage.setItem("showMenuFlag", true);
},
//更改模式
async changeModel(){
this.showMenuFlag=!this.showMenuFlag;
if(this.showMenuFlag){
async changeModel() {
this.showMenuFlag = !this.showMenuFlag;
if (this.showMenuFlag) {
localStorage.setItem("showMenuFlag", true);
}else{
} else {
localStorage.removeItem("showMenuFlag");
}
}
this.router.push({ path: "/home/index" });
},
},
});