From 3f3e2d5977787b0c6e09cd5cba7b41e5fb7d3fd0 Mon Sep 17 00:00:00 2001
From: zzzz <690498789@qq.com>
Date: Sun, 21 Apr 2024 15:59:28 +0800
Subject: [PATCH] first

---
 src/router/router.js |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/router/router.js b/src/router/router.js
index a881ce0..171e0eb 100644
--- a/src/router/router.js
+++ b/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) {
@@ -109,7 +110,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"
@@ -1376,15 +1377,17 @@
     // 判断该路由是否需要登录权限
     if (store.state.user.userInfo.token) {
       // 通过vuex state获取当前的token是否存在
+      if (to.meta.kyc && store.state.user.userInfo.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 {

--
Gitblit v1.9.3