2025-02-20 12:34:25 +08:00
|
|
|
import { createRouter, createWebHistory } from "vue-router";
|
|
|
|
import NProgress from "nprogress";
|
|
|
|
import GlobalLayout from "@/layouts/GlobalLayout.vue";
|
|
|
|
import HomeLayout from "@/layouts/HomeLayout.vue";
|
|
|
|
import PageLayout from "@/layouts/PageLayout.vue";
|
|
|
|
import index from "@/views/index.vue";
|
2025-01-20 16:39:00 +08:00
|
|
|
const router = createRouter({
|
2025-02-20 12:34:25 +08:00
|
|
|
history: createWebHistory(import.meta.env.BASE_URL),
|
|
|
|
routes: [
|
2025-01-20 16:39:00 +08:00
|
|
|
{
|
2025-02-20 12:34:25 +08:00
|
|
|
path: "/",
|
|
|
|
component: GlobalLayout, // 使用 Layout 作为父组件
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: "",
|
|
|
|
component: HomeLayout, // 使用 Layout 作为父组件
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: "",
|
|
|
|
name: "index",
|
|
|
|
component: index,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "ai",
|
|
|
|
name: "ai",
|
|
|
|
component: () => import("@/views/Ai.vue"),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/agent",
|
|
|
|
name: "agent",
|
|
|
|
component: () => import("@/views/Agent.vue"),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "me",
|
|
|
|
name: "me",
|
|
|
|
component: () => import("@/views/Me.vue"),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "",
|
|
|
|
component: PageLayout,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: "/historyQuery",
|
|
|
|
name: "history",
|
|
|
|
component: () => import("@/views/HistoryQuery.vue"),
|
|
|
|
meta: { title: "历史报告" },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/promote",
|
|
|
|
name: "promote",
|
|
|
|
component: () => import("@/views/Promote.vue"),
|
|
|
|
meta: { title: "推广" },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/withdraw",
|
|
|
|
name: "withdraw",
|
|
|
|
component: () => import("@/views/Withdraw.vue"),
|
|
|
|
meta: { title: "提现" },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/service",
|
|
|
|
name: "service",
|
|
|
|
component: () => import("@/views/Service.vue"),
|
|
|
|
meta: { title: "客服" },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/complaint",
|
|
|
|
name: "complaint",
|
|
|
|
component: () => import("@/views/Complaint.vue"),
|
|
|
|
meta: { title: "投诉" },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/report",
|
|
|
|
name: "report",
|
|
|
|
component: () => import("@/views/Report.vue"),
|
|
|
|
meta: { title: "报告结果" },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/example",
|
|
|
|
name: "example",
|
|
|
|
component: () => import("@/views/Example.vue"),
|
|
|
|
meta: { title: "示例报告" },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/authorization",
|
|
|
|
name: "authorization",
|
|
|
|
component: () =>
|
|
|
|
import("@/views/Authorization.vue"),
|
|
|
|
meta: { title: "授权书" },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/privacyPolicy",
|
|
|
|
name: "privacyPolicy",
|
|
|
|
component: () =>
|
|
|
|
import("@/views/PrivacyPolicy.vue"),
|
|
|
|
meta: { title: "隐私政策" },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/userAgreement",
|
|
|
|
name: "userAgreement",
|
|
|
|
component: () =>
|
|
|
|
import("@/views/UserAgreement.vue"),
|
|
|
|
meta: { title: "用户协议" },
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
path: "/inquire/:feature",
|
|
|
|
name: "inquire",
|
|
|
|
component: () => import("@/views/Inquire.vue"),
|
|
|
|
meta: { title: "查询报告" },
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2025-01-20 16:39:00 +08:00
|
|
|
},
|
2025-02-20 12:34:25 +08:00
|
|
|
|
2025-01-20 16:39:00 +08:00
|
|
|
{
|
2025-02-20 12:34:25 +08:00
|
|
|
path: "/login",
|
|
|
|
name: "login",
|
|
|
|
component: () => import("@/views/Login.vue"),
|
2025-01-20 16:39:00 +08:00
|
|
|
},
|
2025-02-20 12:34:25 +08:00
|
|
|
{
|
|
|
|
path: "/promotionInquire/:feature",
|
|
|
|
name: "promotionInquire",
|
|
|
|
component: () => import("@/views/PromotionInquire.vue"),
|
|
|
|
},
|
|
|
|
// {
|
|
|
|
// path: '/home',
|
|
|
|
// name: 'home',
|
|
|
|
// component: () => import('@/views/Home.vue'),
|
|
|
|
// },
|
2025-01-20 16:39:00 +08:00
|
|
|
|
2025-02-20 12:34:25 +08:00
|
|
|
{
|
|
|
|
path: "/:pathMatch(.*)*",
|
|
|
|
name: "NotFound",
|
|
|
|
component: () => import("@/views/NotFound.vue"),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
});
|
2025-01-20 16:39:00 +08:00
|
|
|
NProgress.configure({
|
2025-02-20 12:34:25 +08:00
|
|
|
easing: "ease", // 动画方式
|
|
|
|
speed: 500, // 递增进度条的速度(毫秒)
|
|
|
|
showSpinner: false, // 是否显示加载的圆圈
|
|
|
|
trickleSpeed: 200, // 自动递增间隔
|
|
|
|
minimum: 0.3, // 初始化最小百分比
|
2025-01-20 16:39:00 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
// 路由导航守卫
|
|
|
|
router.beforeEach((to, from, next) => {
|
2025-02-20 12:34:25 +08:00
|
|
|
NProgress.start(); // 启动进度条
|
|
|
|
next();
|
2025-01-20 16:39:00 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
router.afterEach(() => {
|
2025-02-20 12:34:25 +08:00
|
|
|
NProgress.done(); // 结束进度条
|
2025-01-20 16:39:00 +08:00
|
|
|
});
|
2025-02-20 12:34:25 +08:00
|
|
|
export default router;
|