From d707be00de36fd6234dd01361d3e1fcaa1d84dd9 Mon Sep 17 00:00:00 2001 From: fanxb Date: Wed, 16 Mar 2022 16:58:25 +0800 Subject: [PATCH] temp --- bookmark_front/src/router/index.js | 116 +++++++++--------- bookmark_front/src/views/main/Main.vue | 1 + .../src/views/main/pages/home/index.vue | 13 ++ .../{things => manage}/BookmarkManage.vue | 0 4 files changed, 75 insertions(+), 55 deletions(-) create mode 100644 bookmark_front/src/views/main/pages/home/index.vue rename bookmark_front/src/views/main/pages/{things => manage}/BookmarkManage.vue (100%) diff --git a/bookmark_front/src/router/index.js b/bookmark_front/src/router/index.js index ea52f0e..e65fa55 100644 --- a/bookmark_front/src/router/index.js +++ b/bookmark_front/src/router/index.js @@ -1,8 +1,9 @@ import Vue from "vue"; import VueRouter from "vue-router"; import Main from "../views/main/Main.vue"; +import HOME from "../views/main/pages/home/index"; import UserInfo from "../views/main/pages/personSpace/UserInfo.vue"; -import BookmarkManage from "../views/main/pages/things/BookmarkManage.vue"; +import BookmarkManage from "../views/main/pages/manage/BookmarkManage.vue"; import Public from "../views/public/Public.vue"; import Login from "../views/public/pages/Login.vue"; @@ -13,63 +14,68 @@ import GithubOauth from "../views/public/pages/oauth/Github.vue"; Vue.use(VueRouter); const routes = [ - { - path: "/", - component: Main, - children: [ - { - path: "", - name: "BookmarkManage", - component: BookmarkManage - }, - { - path: "personSpace/userInfo", - name: "UserInfo", - component: UserInfo - } - ] - }, - { - path: "/public", - name: "Public", - component: Public, - children: [ - { - path: "login", - name: "Login", - component: Login - }, - { - path: "register", - name: "Register", - component: Register - }, - { - path: "resetPassword", - name: "ResetPassword", - component: ResetPassword - }, - { - path: "oauth/github", - name: "GithubRedirect", - component: GithubOauth - }, - { - path: "notFound", - name: "NOTFOUND", - component: () => import("@/views/public/pages/NotFound") - } - ] - }, - { - path: "*", - redirect: "/public/notFound" - } + { + path: "/", + component: Main, + children: [ + { + path: "", + name: "HOME", + component: HOME + }, + { + path: "/manage", + name: "BookmarkManage", + component: BookmarkManage + }, + { + path: "personSpace/userInfo", + name: "UserInfo", + component: UserInfo + } + ] + }, + { + path: "/public", + name: "Public", + component: Public, + children: [ + { + path: "login", + name: "Login", + component: Login + }, + { + path: "register", + name: "Register", + component: Register + }, + { + path: "resetPassword", + name: "ResetPassword", + component: ResetPassword + }, + { + path: "oauth/github", + name: "GithubRedirect", + component: GithubOauth + }, + { + path: "notFound", + name: "NOTFOUND", + component: () => import("@/views/public/pages/NotFound") + } + ] + }, + { + path: "*", + redirect: "/public/notFound" + } ]; const router = new VueRouter({ - mode: "history", - routes + mode: "history", + routes }); export default router; diff --git a/bookmark_front/src/views/main/Main.vue b/bookmark_front/src/views/main/Main.vue index 66a5119..0f3d9a8 100644 --- a/bookmark_front/src/views/main/Main.vue +++ b/bookmark_front/src/views/main/Main.vue @@ -35,6 +35,7 @@ export default { await this.$store.dispatch("treeData/init"); console.log("treeData加载完毕"); console.log("state数据:", this.$store.state); + //数据初始化时会检查版本情况,因此循环检查,五分钟后开始 this.timer = setInterval(this.checkVersion, 5 * 60 * 1000); }, destroyed() { diff --git a/bookmark_front/src/views/main/pages/home/index.vue b/bookmark_front/src/views/main/pages/home/index.vue new file mode 100644 index 0000000..76b86ac --- /dev/null +++ b/bookmark_front/src/views/main/pages/home/index.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/bookmark_front/src/views/main/pages/things/BookmarkManage.vue b/bookmark_front/src/views/main/pages/manage/BookmarkManage.vue similarity index 100% rename from bookmark_front/src/views/main/pages/things/BookmarkManage.vue rename to bookmark_front/src/views/main/pages/manage/BookmarkManage.vue