This commit is contained in:
fanxb 2022-03-16 16:58:25 +08:00
parent c7b82047ae
commit d707be00de
4 changed files with 75 additions and 55 deletions

View File

@ -1,8 +1,9 @@
import Vue from "vue"; import Vue from "vue";
import VueRouter from "vue-router"; import VueRouter from "vue-router";
import Main from "../views/main/Main.vue"; 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 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 Public from "../views/public/Public.vue";
import Login from "../views/public/pages/Login.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); Vue.use(VueRouter);
const routes = [ const routes = [
{ {
path: "/", path: "/",
component: Main, component: Main,
children: [ children: [
{ {
path: "", path: "",
name: "BookmarkManage", name: "HOME",
component: BookmarkManage component: HOME
}, },
{ {
path: "personSpace/userInfo", path: "/manage",
name: "UserInfo", name: "BookmarkManage",
component: UserInfo component: BookmarkManage
} },
] {
}, path: "personSpace/userInfo",
{ name: "UserInfo",
path: "/public", component: UserInfo
name: "Public", }
component: Public, ]
children: [ },
{ {
path: "login", path: "/public",
name: "Login", name: "Public",
component: Login component: Public,
}, children: [
{ {
path: "register", path: "login",
name: "Register", name: "Login",
component: Register component: Login
}, },
{ {
path: "resetPassword", path: "register",
name: "ResetPassword", name: "Register",
component: ResetPassword component: Register
}, },
{ {
path: "oauth/github", path: "resetPassword",
name: "GithubRedirect", name: "ResetPassword",
component: GithubOauth component: ResetPassword
}, },
{ {
path: "notFound", path: "oauth/github",
name: "NOTFOUND", name: "GithubRedirect",
component: () => import("@/views/public/pages/NotFound") component: GithubOauth
} },
] {
}, path: "notFound",
{ name: "NOTFOUND",
path: "*", component: () => import("@/views/public/pages/NotFound")
redirect: "/public/notFound" }
} ]
},
{
path: "*",
redirect: "/public/notFound"
}
]; ];
const router = new VueRouter({ const router = new VueRouter({
mode: "history", mode: "history",
routes routes
}); });
export default router; export default router;

View File

@ -35,6 +35,7 @@ export default {
await this.$store.dispatch("treeData/init"); await this.$store.dispatch("treeData/init");
console.log("treeData加载完毕"); console.log("treeData加载完毕");
console.log("state数据:", this.$store.state); console.log("state数据:", this.$store.state);
//
this.timer = setInterval(this.checkVersion, 5 * 60 * 1000); this.timer = setInterval(this.checkVersion, 5 * 60 * 1000);
}, },
destroyed() { destroyed() {

View File

@ -0,0 +1,13 @@
<template>
<div>这是主页面</div>
</template>
<script>
export default {
name: "HOME",
data() {},
methods: { },
};
</script>
<style lang="less" scoped></style>