新增消息列表

This commit is contained in:
2023-09-27 15:16:08 +08:00
parent b0fea79781
commit 5ada449282
10 changed files with 514 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ import _hook from "@/hooks/index.js";
import { useRoutes } from "@/store/routes.js";
import NProgress from "nprogress";
import "nprogress/nprogress.css";
import { useUser } from "@/store/user.js";
const router = createRouter({
history: createWebHistory(),
@@ -15,6 +16,7 @@ NProgress.configure({ showSpinner: false });
router.beforeEach(async (to, from, next) => {
NProgress.start();
const token = _hook.useLocalStorage.get("token");
const storeUser = useUser();
if (to.path === "/login" && !token) {
next();
NProgress.done();
@@ -36,6 +38,7 @@ router.beforeEach(async (to, from, next) => {
storeRoutes.setNavbar(to.path);
next();
NProgress.done();
storeUser.getNotices()
}
}
}