2023-12-14 10:15:23 +08:00
|
|
|
|
import { createRouter, createWebHistory } from "vue-router";
|
|
|
|
|
|
import Layout from "../layout/Index.vue";
|
|
|
|
|
|
import NotFound from "../views/error/404.vue";
|
|
|
|
|
|
import LoginLayout from "../layout/LoginLayout.vue";
|
2024-01-25 20:32:01 +08:00
|
|
|
|
import ActivityLayout from "../layout/activity/Index.vue";
|
2024-04-02 18:41:41 +08:00
|
|
|
|
import ChatLayout from "../layout/ChatLayout.vue"
|
2023-12-14 10:15:23 +08:00
|
|
|
|
const router = createRouter({
|
|
|
|
|
|
history: createWebHistory(import.meta.env.BASE_URL),
|
|
|
|
|
|
scrollBehavior(to, from, savedPosition) {
|
|
|
|
|
|
// 始终滚动到顶部
|
|
|
|
|
|
return { top: 0 };
|
|
|
|
|
|
},
|
|
|
|
|
|
routes: [
|
|
|
|
|
|
{
|
|
|
|
|
|
name: "test",
|
|
|
|
|
|
path: "/test",
|
|
|
|
|
|
component: () => import("../views/Test.vue"),
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
path: "/loginLayout",
|
|
|
|
|
|
name: "loginLayout",
|
|
|
|
|
|
component: LoginLayout,
|
|
|
|
|
|
redirect: "/login",
|
|
|
|
|
|
children: [
|
|
|
|
|
|
{
|
|
|
|
|
|
name: "login",
|
|
|
|
|
|
path: "/login",
|
2023-12-19 00:21:25 +08:00
|
|
|
|
// component: () => import("../views/Login.vue"),
|
2024-10-04 00:00:44 +08:00
|
|
|
|
component: () => import("../views/login/login.vue"),
|
2023-12-14 10:15:23 +08:00
|
|
|
|
},
|
2024-10-03 01:10:32 +08:00
|
|
|
|
{
|
|
|
|
|
|
name: "register",
|
|
|
|
|
|
path: "/register",
|
|
|
|
|
|
component: () => import("../views/login/register.vue"),
|
|
|
|
|
|
},
|
2024-10-04 00:00:44 +08:00
|
|
|
|
{
|
|
|
|
|
|
name: "forgotPassword",
|
|
|
|
|
|
path: "/forgotPassword",
|
|
|
|
|
|
component: () => import("../views/login/forgotPassword.vue"),
|
|
|
|
|
|
},
|
2024-01-07 00:27:44 +08:00
|
|
|
|
{
|
2024-01-08 21:41:23 +08:00
|
|
|
|
name: "auth",
|
|
|
|
|
|
path: "/auth/:type",
|
|
|
|
|
|
component: () => import("../views/Auth/index.vue"),
|
2024-01-07 00:27:44 +08:00
|
|
|
|
meta: {
|
2024-01-08 21:41:23 +08:00
|
|
|
|
title: "授权",
|
2024-01-07 00:27:44 +08:00
|
|
|
|
},
|
|
|
|
|
|
},
|
2023-12-14 10:15:23 +08:00
|
|
|
|
],
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
path: "/",
|
|
|
|
|
|
name: "layout",
|
|
|
|
|
|
component: Layout,
|
|
|
|
|
|
redirect: "/index",
|
|
|
|
|
|
children: [
|
|
|
|
|
|
{
|
|
|
|
|
|
name: "index",
|
|
|
|
|
|
path: "/index",
|
|
|
|
|
|
component: () => import("../views/home/Index.vue"),
|
2023-12-17 11:57:46 +08:00
|
|
|
|
meta: {
|
|
|
|
|
|
title: "首页",
|
|
|
|
|
|
},
|
2023-12-14 10:15:23 +08:00
|
|
|
|
},
|
2024-06-03 22:21:02 +08:00
|
|
|
|
{
|
|
|
|
|
|
name: "start",
|
|
|
|
|
|
path: "/start",
|
|
|
|
|
|
component: () => import("../views/start/Index.vue"),
|
|
|
|
|
|
meta: {
|
|
|
|
|
|
title: "开始",
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2023-12-14 10:15:23 +08:00
|
|
|
|
{
|
|
|
|
|
|
name: "article",
|
|
|
|
|
|
path: "/article/:discussId/:articleId?",
|
|
|
|
|
|
component: () => import("../views/Article.vue"),
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: "discuss",
|
2023-12-20 23:29:55 +08:00
|
|
|
|
path: "/discuss/:plateId?/:isPublish?",
|
2024-01-06 16:41:57 +08:00
|
|
|
|
component: () => import("../views/discuss/index.vue"),
|
2023-12-17 11:57:46 +08:00
|
|
|
|
meta: {
|
|
|
|
|
|
title: "板块",
|
|
|
|
|
|
},
|
2023-12-14 10:15:23 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
//artType:discuss主题、article文章
|
|
|
|
|
|
//operType:create创建、update更新
|
|
|
|
|
|
name: "editArt",
|
|
|
|
|
|
path: "/editArt",
|
|
|
|
|
|
component: () => import("../views/EditArticle.vue"),
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: "profile",
|
2024-01-17 16:31:01 +08:00
|
|
|
|
path: "/profile/:userName",
|
2023-12-14 10:15:23 +08:00
|
|
|
|
component: () => import("../views/profile/Index.vue"),
|
|
|
|
|
|
},
|
2023-12-17 11:57:46 +08:00
|
|
|
|
{
|
|
|
|
|
|
name: "themeCover",
|
|
|
|
|
|
path: "/article/:discussId",
|
|
|
|
|
|
component: () => import("../views/Article.vue"),
|
|
|
|
|
|
meta: {
|
2025-02-04 15:23:20 +08:00
|
|
|
|
title: "主题首页",
|
2023-12-17 11:57:46 +08:00
|
|
|
|
},
|
|
|
|
|
|
},
|
2023-12-24 20:05:34 +08:00
|
|
|
|
{
|
|
|
|
|
|
name: "contact",
|
|
|
|
|
|
path: "/contact",
|
|
|
|
|
|
component: () => import("../views/contact/index.vue"),
|
|
|
|
|
|
meta: {
|
|
|
|
|
|
title: "联系我们",
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2024-08-09 22:39:27 +08:00
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
name:"money",
|
|
|
|
|
|
path:"/money",
|
|
|
|
|
|
component: () => import("../views/money/Index.vue"),
|
|
|
|
|
|
meta: {
|
2024-11-02 19:50:01 +08:00
|
|
|
|
title: "钱钱排行榜",
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name:"shop",
|
|
|
|
|
|
path:"/shop",
|
|
|
|
|
|
component: () => import("../views/shop/Index.vue"),
|
|
|
|
|
|
meta: {
|
|
|
|
|
|
title: "商城",
|
2024-08-09 22:39:27 +08:00
|
|
|
|
},
|
|
|
|
|
|
},
|
2024-11-12 22:29:06 +08:00
|
|
|
|
{
|
|
|
|
|
|
name:"dc",
|
|
|
|
|
|
path:"/dc",
|
|
|
|
|
|
component: () => import("../views/dc/Index.vue"),
|
|
|
|
|
|
meta: {
|
|
|
|
|
|
title: "数字藏品",
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2025-02-06 11:41:56 +08:00
|
|
|
|
{
|
|
|
|
|
|
name: "book",
|
|
|
|
|
|
path: "/book",
|
|
|
|
|
|
component: () => import("../views/book/Index.vue"),
|
|
|
|
|
|
meta: {
|
|
|
|
|
|
title: "面试宝典",
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2023-12-14 10:15:23 +08:00
|
|
|
|
],
|
|
|
|
|
|
},
|
2024-01-11 23:51:09 +08:00
|
|
|
|
{
|
2024-01-25 20:32:01 +08:00
|
|
|
|
path: "/activity",
|
|
|
|
|
|
name: "activityLayout",
|
|
|
|
|
|
component: ActivityLayout,
|
|
|
|
|
|
redirect: "/activity/sign",
|
2024-01-11 23:51:09 +08:00
|
|
|
|
children: [
|
|
|
|
|
|
{
|
2024-01-25 20:32:01 +08:00
|
|
|
|
name: "sign",
|
|
|
|
|
|
path: "sign",
|
|
|
|
|
|
component: () => import("../views/signIn/Index.vue"),
|
2024-01-11 23:51:09 +08:00
|
|
|
|
meta: {
|
|
|
|
|
|
title: "每日签到",
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2024-01-29 18:26:51 +08:00
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
name: "level",
|
|
|
|
|
|
path: "level",
|
|
|
|
|
|
component: () => import("../views/level/Index.vue"),
|
|
|
|
|
|
meta: {
|
|
|
|
|
|
title: "等级",
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2024-02-26 18:44:11 +08:00
|
|
|
|
{
|
|
|
|
|
|
name: "lucky",
|
|
|
|
|
|
path: "lucky",
|
|
|
|
|
|
component: () => import("../views/lucky/Index.vue"),
|
|
|
|
|
|
meta: {
|
|
|
|
|
|
title: "大转盘",
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2024-03-03 15:58:19 +08:00
|
|
|
|
{
|
|
|
|
|
|
name: "bank",
|
|
|
|
|
|
path: "bank",
|
|
|
|
|
|
component: () => import("../views/bank/Index.vue"),
|
|
|
|
|
|
meta: {
|
|
|
|
|
|
title: "银行",
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2024-08-12 23:23:29 +08:00
|
|
|
|
{
|
|
|
|
|
|
name: "assignment",
|
|
|
|
|
|
path: "assignment",
|
|
|
|
|
|
component: () => import("../views/assignment/Index.vue"),
|
|
|
|
|
|
meta: {
|
|
|
|
|
|
title: "任务",
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2024-01-11 23:51:09 +08:00
|
|
|
|
],
|
|
|
|
|
|
},
|
2025-03-09 16:21:39 +08:00
|
|
|
|
{
|
|
|
|
|
|
name: "stock",
|
|
|
|
|
|
path: "/stock",
|
|
|
|
|
|
component: () => import("../views/stock/Index.vue"),
|
|
|
|
|
|
meta: {
|
|
|
|
|
|
title: "股票",
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2024-04-02 18:41:41 +08:00
|
|
|
|
{
|
2024-04-03 16:39:06 +08:00
|
|
|
|
path: "/hub",
|
|
|
|
|
|
name: "hub",
|
2024-04-02 18:41:41 +08:00
|
|
|
|
component: ChatLayout,
|
2024-04-03 16:39:06 +08:00
|
|
|
|
redirect: "/chat",
|
2024-04-02 18:41:41 +08:00
|
|
|
|
children: [
|
|
|
|
|
|
{
|
|
|
|
|
|
name: "main",
|
2024-04-03 16:39:06 +08:00
|
|
|
|
path: "/chat",
|
2024-04-02 18:41:41 +08:00
|
|
|
|
component: () => import("../views/chathub/Index.vue"),
|
|
|
|
|
|
meta: {
|
|
|
|
|
|
title: "聊天室",
|
|
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
|
|
|
|
|
|
2023-12-14 10:15:23 +08:00
|
|
|
|
{ path: "/:pathMatch(.*)*", name: "NotFound", component: NotFound },
|
|
|
|
|
|
],
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
export default router;
|