@@ -28,10 +28,12 @@ export default {
methods: {
async menuClick({ key }) {
if (key === "logout") {
+ //推出登录清理缓存
+ await this.$store.dispatch("treeData/clear");
await this.$store.dispatch("globalConfig/clear");
this.$router.replace("/public/login");
} else if (key === "personSpace") {
- this.$router.push("/personSpace/userInfo");
+ this.$router.push("/manage/personSpace/userInfo");
}
},
},
diff --git a/bookmark_front/src/router/index.js b/bookmark_front/src/router/index.js
index e277616..7cfb98f 100644
--- a/bookmark_front/src/router/index.js
+++ b/bookmark_front/src/router/index.js
@@ -12,6 +12,7 @@ const routes = [
path: "/manage",
component: () => import("@/views/manage/index"),
children: [
+ { path: "", redirect: "/manage/bookmarkTree" },
{ path: "bookmarkTree", component: () => import("@/views/manage/bookmarkTree/index") },
{ path: "personSpace/userInfo", component: () => import("@/views/manage/personSpace/index") },
]
@@ -46,7 +47,9 @@ router.beforeEach(async (to, from, next) => {
let supportNoLogin = to.path === '/' || to.path.startsWith("/public");
vuex.default.commit(GLOBAL_CONFIG + "/" + SUPPORT_NO_LOGIN, supportNoLogin);
if (!supportNoLogin && !checkJwtValid(vuex.default.state[GLOBAL_CONFIG][TOKEN])) {
- //如不支持未登录进入,切jwt已过期,直接跳转到登录页面
+ //如不支持未登录进入,切jwt已过期,直接跳转到登录页面,并清理缓存
+ await vuex.default.dispatch("treeData/clear");
+ await vuex.default.dispatch("globalConfig/clear");
next({
path: "/public/login?to=" + btoa(location.href),
replace: true
diff --git a/bookmark_front/src/util/HttpUtil.js b/bookmark_front/src/util/HttpUtil.js
index 3bcf934..c3fda9a 100644
--- a/bookmark_front/src/util/HttpUtil.js
+++ b/bookmark_front/src/util/HttpUtil.js
@@ -43,6 +43,9 @@ async function request (url, method, params, body, isForm, redirect) {
} else if (code === -1 && redirect) {
//未登陆,根据redirect参数判断是否需要跳转到登陆页
window.vueInstance.$message.error("您尚未登陆,请先登陆");
+ //跳转到登录页面需要清理缓存
+ await this.$store.dispatch("treeData/clear");
+ await this.$store.dispatch("globalConfig/clear");
router.replace(`/public/login?redirect=${encodeURIComponent(router.currentRoute.fullPath)}`);
throw new Error(message);
} else if (code === 0) {
diff --git a/bookmark_front/src/views/home/header.vue b/bookmark_front/src/views/home/header.vue
deleted file mode 100644
index ef86946..0000000
--- a/bookmark_front/src/views/home/header.vue
+++ /dev/null
@@ -1,12 +0,0 @@
-
- 表头
-
-
-
-
-
diff --git a/bookmark_front/src/views/home/index.vue b/bookmark_front/src/views/home/index.vue
index fecf8d6..9bcd465 100644
--- a/bookmark_front/src/views/home/index.vue
+++ b/bookmark_front/src/views/home/index.vue
@@ -1,13 +1,24 @@
- 这是主页面
+