123
dcc
2024-06-28 25b2ba1cf86bc3439e7ad2acf2cd4a9ea7e4b0ed
src/router/router.js
@@ -3,6 +3,7 @@
import store from "../store";
Vue.use(Router);
import { Toast } from "vant";
import i18n from "@/i18n";
const router = new Router({
  scrollBehavior(to, from, savedPosition) {
@@ -37,10 +38,19 @@
          /* webpackChunkName: "Home" */ /* webpackPrefetch: true */ "@/page/assetsCenter/index.vue"
        ),
    },
   {
     //个人中心
     path: "/userCenter",
     name: "userCenter",
     meta: { footer: true, requireAuth: true },
     component: () =>
       import(
         /* webpackChunkName: "userCenter" */ /* webpackPrefetch: true */ "@/page/userCenter/index.vue"
       ),
   },
    {
      path: "/profile",
      name: "profile",
      meta: { footer: true, requireAuth: true },
      component: () =>
        import(
          /* webpackChunkName: "Home" */ /* webpackPrefetch: true */ "@/page/assetsCenter/profile.vue"
@@ -109,7 +119,7 @@
      //提现页面
      path: "/withdraw/withdrawPage",
      name: "withdrawPage",
      meta: { index: 9 },
      meta: { index: 9, kyc: true, requireAuth: true },
      component: () =>
        import(
          /* webpackChunkName: "withdrawPage" */ /* webpackPrefetch: true */ "@/page/withdraw/withdrawPage.vue"
@@ -560,15 +570,7 @@
          /* webpackChunkName: "safeVerify" */ /* webpackPrefetch: true */ "@/page/forget/safeVerify.vue"
        ),
    },
    {
      //个人中心
      path: "/userCenter",
      name: "userCenter",
      component: () =>
        import(
          /* webpackChunkName: "userCenter" */ /* webpackPrefetch: true */ "@/page/userCenter/index.vue"
        ),
    },
    {
      //安全中心
      path: "/safety",
@@ -1376,15 +1378,18 @@
    // 判断该路由是否需要登录权限
    if (store.state.user.userInfo.token) {
      // 通过vuex state获取当前的token是否存在
      if (to.meta.kyc && store.state.user.kyc !== 2) {
        return Toast.fail(i18n.t("请先实名认证!"));
      }
      if (to.meta.isMerchant) {
        if (store.state.user.userInfo.c2c_user_type !== 0) {
          next();
        } else {
          Toast(this.$t("您不是承兑商"));
          Toast.fail(i18n.t("您不是承兑商!"));
          next("/");
        }
      } else {
        next();
      }
      next();
    } else {