| | |
| | | import store from "../store"; |
| | | Vue.use(Router); |
| | | import { Toast } from "vant"; |
| | | import i18n from "@/i18n"; |
| | | |
| | | const router = new Router({ |
| | | scrollBehavior(to, from, savedPosition) { |
| | |
| | | //提现页面 |
| | | 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" |
| | |
| | | // 判断该路由是否需要登录权限 |
| | | 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 { |