Merge branch 'master' of github.com:youlaitech/vue3-element-admin
This commit is contained in:
@@ -41,8 +41,6 @@ const appStore = useAppStore();
|
||||
const permissionStore = usePermissionStore();
|
||||
const router = useRouter();
|
||||
|
||||
console.log("当前路由", useRoute().path);
|
||||
|
||||
// 避免 activeTopMenuPath 缓存被清理,从当前路由路径获取顶部菜单路径,eg. /system/user → /system
|
||||
const activeTopMenuPath = useRoute().path.match(/^\/[^\/]+/)?.[0] || "/";
|
||||
appStore.activeTopMenu(activeTopMenuPath);
|
||||
|
||||
@@ -3,6 +3,7 @@ export const useTagsViewStore = defineStore("tagsView", () => {
|
||||
const cachedViews = ref<string[]>([]);
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
/**
|
||||
* 添加已访问视图到已访问视图列表中
|
||||
*/
|
||||
@@ -144,6 +145,7 @@ export const useTagsViewStore = defineStore("tagsView", () => {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function delRightViews(view: TagView) {
|
||||
return new Promise((resolve) => {
|
||||
const currIndex = visitedViews.value.findIndex(
|
||||
@@ -209,6 +211,7 @@ export const useTagsViewStore = defineStore("tagsView", () => {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function isActive(tag: TagView) {
|
||||
return tag.path === route.path;
|
||||
}
|
||||
@@ -228,6 +231,7 @@ export const useTagsViewStore = defineStore("tagsView", () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
visitedViews,
|
||||
cachedViews,
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import AuthAPI, { LoginData } from "@/api/auth";
|
||||
import UserAPI, { UserInfo } from "@/api/user";
|
||||
import AuthAPI, { type LoginData } from "@/api/auth";
|
||||
import UserAPI, { type UserInfo } from "@/api/user";
|
||||
import { resetRouter } from "@/router";
|
||||
import { store } from "@/store";
|
||||
|
||||
import { TOKEN_KEY } from "@/enums/CacheEnum";
|
||||
|
||||
export const useUserStore = defineStore("user", () => {
|
||||
|
||||
@@ -9,7 +9,6 @@ const service = axios.create({
|
||||
baseURL: import.meta.env.VITE_APP_BASE_API,
|
||||
timeout: 50000,
|
||||
headers: { "Content-Type": "application/json;charset=utf-8" },
|
||||
|
||||
paramsSerializer: (params) => {
|
||||
return qs.stringify(params);
|
||||
},
|
||||
|
||||
@@ -120,7 +120,7 @@ import { LocationQuery, useRoute } from "vue-router";
|
||||
|
||||
// 内部依赖
|
||||
import { useSettingsStore, useUserStore } from "@/store";
|
||||
import AuthAPI, { LoginData } from "@/api/auth";
|
||||
import AuthAPI, { type LoginData } from "@/api/auth";
|
||||
import router from "@/router";
|
||||
import defaultSettings from "@/settings";
|
||||
import { ThemeEnum } from "@/enums/ThemeEnum";
|
||||
@@ -158,7 +158,7 @@ const loginData = ref<LoginData>({
|
||||
password: "123456",
|
||||
captchaKey: "",
|
||||
captchaCode: "",
|
||||
} as LoginData);
|
||||
});
|
||||
|
||||
const loginRules = computed(() => {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user