| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056 |
- import { setLoadComplete } from '@/common/methods';
- import { getLoadIsComplete } from '@/common/methods/mixin';
- import Main from '@/layout/components/main.vue';
- import Layout from '@/layout/index.vue';
- import { globalDataRefresh } from '@/services/bus';
- import { isLogin, login } from '@/services/bus/login';
- import { localStorageUtil } from '@/utils/storage';
- import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
- import eventBus from '../utils/eventBus';
- const routes: Array<RouteRecordRaw> = [
- {
- path: '/login',
- name: 'login',
- component: () => import('@/views/account/login.vue'),
- },
- {
- path: '/logon',
- name: 'logon',
- component: () => import('@/views/account/logon.vue'),
- },
- {
- path: '/resetPassword',
- name: 'resetPassword',
- component: () => import('@/views/account/resetPassword.vue'),
- },
- {
- path: '/',
- component: Layout,
- props: true,
- redirect: '/login',
- children: [
- {
- path: '/home',
- name: 'home',
- component: () => import('@/views/home.vue'),
- },
- {
- path: '/futures',
- name: 'forward',
- component: () => import('@/views/market/forward/index.vue'),
- },
- {
- path: '/warehouse-trade',
- name: 'warehouseTrade',
- component: () => import('@/views/market/warehouseTrade/index.vue'),
- },
- {
- path: 'custom_info',
- name: 'custom_info',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: (to) => {
- return { name: 'custom_info_unsubmit' };
- },
- children: [
- {
- path: '/custom_info/custom_info_normal',
- name: 'custom_info_normal',
- component: () => import('@/views/information/custom/list/normal-use/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/custom_info/custom_info_disabled',
- name: 'custom_info_disabled',
- component: () => import('@/views/information/custom/list/stop-use/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/custom_info/custom_info_checkpending',
- name: 'custom_info_checkpending',
- component: () => import('@/views/information/custom/list/checkpending/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/custom_info/custom_info_unsubmit',
- name: 'custom_info_unsubmit',
- component: () => import('@/views/information/custom/list/unsubmit/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ],
- },
- {
- path: 'goods_info',
- name: 'goods_info',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: (to) => {
- return { name: 'goods_info_spot' };
- },
- children: [
- {
- path: '/goods_info/goods_info_spot',
- name: 'goods_info_spot',
- component: () => import('@/views/information/goods/list/spot-variety/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/goods_info/goods_info_hedge',
- name: 'goods_info_hedge',
- component: () => import('@/views/information/goods/list/hedging-variety/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ],
- },
- {
- path: '/spot_contract',
- name: 'spot_contract',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: (to) => {
- return { name: 'spot_contract_unsubmitted' };
- },
- children: [
- {
- path: '/spot_contract/spot_contract_unsubmitted',
- name: 'spot_contract_unsubmitted',
- component: () => import('@/views/information/spot-contract/list/unsubmitted/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/spot_contract/spot_contract_checkpending',
- name: 'spot_contract_checkpending',
- component: () => import('@/views/information/spot-contract/list/checkpending/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/spot_contract/spot_contract_performance',
- name: 'spot_contract_performance',
- component: () => import('@/views/information/spot-contract/list/performance/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/spot_contract/spot_contract_finished',
- name: 'spot_contract_finished',
- component: () => import('@/views/information/spot-contract/list/finished/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ],
- },
- {
- path: '/account_info',
- name: 'account_info',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: (to) => {
- return { name: 'account_info_business' };
- },
- children: [
- {
- path: '/account_info/account_info_business',
- name: 'account_info_business',
- component: () => import('@/views/information/account_info/list/account_info_business/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/account_info/account_info_futures',
- name: 'account_info_futures',
- component: () => import('@/views/information/account_info/list/account_info_futures/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/account_info/account_info_manager',
- name: 'account_info_manager',
- component: () => import('@/views/information/account_info/list/account_info_manager/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/account_info/account_info_trade',
- name: 'account_info_trade',
- component: () => import('@/views/information/account_info/list/account_info_trade/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ],
- },
- {
- path: '/warehouse_info',
- name: 'warehouse_info',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: (to) => {
- return { name: 'warehouse_info_normal' };
- },
- children: [
- {
- path: '/warehouse_info/warehouse_info_normal',
- name: 'warehouse_info_normal',
- component: () => import('@/views/information/warehouse-info/list/normal-use/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/warehouse_info/warehouse_info_disabled',
- name: 'warehouse_info_disabled',
- component: () => import('@/views/information/warehouse-info/list/stop-use/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ],
- },
- {
- path: '/outaccount_status',
- name: 'outaccount_status',
- component: () => import('@/views/search/outaccount_status/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/inventory',
- name: 'inventory',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: (to) => {
- return { name: 'inventory_current' };
- },
- children: [
- {
- path: '/inventory/inventory_current',
- name: 'inventory_current',
- component: () => import('@/views/search/inventory/list/inventory_current/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/inventory/inventory_applyrecord',
- name: 'inventory_applyrecord',
- component: () => import('@/views/search/inventory/list/inventory_applyrecord/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/purchase',
- name: 'purchase',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'purchase_pending' },
- children: [
- {
- path: '/purchase/purchase_pending',
- name: 'purchase_pending',
- component: () => import('@/views/business/purchase/list/pending/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/purchase/purchase_performance',
- name: 'purchase_performance',
- component: () => import('@/views/business/purchase/list/performance/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/purchase/purchase_all',
- name: 'purchase_all',
- component: () => import('@/views/business/purchase/list/all/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ],
- },
- {
- path: '/sell',
- name: 'sell',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'sell_pending' },
- children: [
- {
- path: '/sell/sell_pending',
- name: 'sell_pending',
- component: () => import('@/views/business/sell/list/pending/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/sell/sell_performance',
- name: 'sell_performance',
- component: () => import('@/views/business/sell/list/performance/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/sell/sell_all',
- name: 'sell_all',
- component: () => import('@/views/business/sell/list/all/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ],
- },
- {
- path: '/exposure',
- name: 'exposure',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'exposure_realtime' },
- children: [
- {
- path: '/exposure/exposure_realtime',
- name: 'exposure_realtime',
- component: () => import('@/views/business/exposure/list/realTime/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/exposure/exposure_spot',
- name: 'exposure_spot',
- component: () => import('@/views/business/exposure/list/spot/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/exposure/exposure_futures',
- name: 'exposure_futures',
- component: () => import('@/views/business/exposure/list/futures/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/exposure/exposure_history',
- name: 'exposure_history',
- component: () => import('@/views/business/exposure/list/history/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ],
- },
- {
- path: '/plan',
- name: 'plan',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'plan_uncommitted' },
- children: [
- {
- path: '/plan/plan_uncommitted',
- name: 'plan_uncommitted',
- component: () => import('@/views/business/plan/list/uncommitted/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/plan/plan_audit',
- name: 'plan_audit',
- component: () => import('@/views/business/plan/list/audit/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/plan/plan_running',
- name: 'plan_running',
- component: () => import('@/views/business/plan/list/running/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ],
- },
- {
- path: 'review',
- name: 'business_review',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'business_review_someprice' },
- children: [
- {
- path: '/business_review/business_review_someprice',
- name: 'business_review_someprice',
- component: () => import('@/views/manage/business-review/list/someprice/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/business_review/business_review_settlement',
- name: 'business_review_settlement',
- component: () => import('@/views/manage/business-review/list/settlement/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/finance_review',
- name: 'finance_review',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'finance_review_funds' },
- children: [
- {
- path: '/finance_review/finance_review_funds',
- name: 'finance_review_funds',
- component: () => import('@/views/manage/finance-review/list/funds/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/finance_review/finance_review_invoice',
- name: 'finance_review_invoice',
- component: () => import('@/views/manage/finance-review/list/invoice/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/inventory_review',
- name: 'inventory_review',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'inventory_review_checkin' },
- children: [
- {
- path: '/inventory_review/inventory_review_checkin',
- name: 'inventory_review_checkin',
- component: () => import('@/views/manage/inventory-review/list/checkin/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/inventory_review/inventory_review_checkout',
- name: 'inventory_review_checkout',
- component: () => import('@/views/manage/inventory-review/list/checkout/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/exposure_report',
- name: 'exposure_report',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'exposure_report_exposure' },
- children: [
- {
- path: '/exposure_report/exposure_report_exposure',
- name: 'exposure_report_exposure',
- component: () => import('@/views/report/exposure-report/list/exposure_report/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/finance_report',
- name: 'finance_report',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'finance_report_finance' },
- children: [
- {
- path: '/finance_report/finance_report_finance',
- name: 'finance_report_finance',
- component: () => import('@/views/report/finance-report/list/finance_report_finance/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/inventory_report',
- name: 'inventory_report',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'inventory_report_inventory_category' },
- children: [
- {
- path: '/inventory_report/inventory_report_inventory_category',
- name: 'inventory_report_inventory_category',
- component: () => import('@/views/report/inventory-report/list/category/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/inventory_report/warehouse',
- name: 'inventory_report_warehouse',
- component: () => import('@/views/report/inventory-report/list/warehouse/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/spot_report',
- name: 'spot_report',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'spot_report_spot' },
- children: [
- {
- path: '/spot_report/spot_report_spot',
- name: 'spot_report_spot',
- component: () => import('@/views/report/spot-report/list/spot_report/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/sum_pl_report',
- name: 'sum_pl_report',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'sum_pl_report_sum_pl' },
- children: [
- {
- path: '/sum_pl_report/sum_pl_report_sum_pl',
- name: 'sum_pl_report_sum_pl',
- component: () => import('@/views/report/sum_pl_report/list/sum_pl_report/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/future_report',
- name: 'future_report',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'future_report_future' },
- children: [
- {
- path: '/future_report/future_report_future',
- name: 'future_report_future',
- component: () => import('@/views/report/future_report/list/future_report/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/platinum_customer_info',
- name: 'platinum_customer_info',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'platinum_custom_info_normal' },
- children: [
- {
- path: '/platinum_customer_info/platinum_custom_info_normal',
- name: 'platinum_custom_info_normal',
- component: () => import('@/views/platinum/platinum_customer_info/list/normal-use/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/platinum_customer_info/platinum_customer_info_unsubmit',
- name: 'platinum_customer_info_unsubmit',
- component: () => import('@/views/platinum/platinum_customer_info/list/unsubmit/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/platinum_customer_info/platinum_customer_info_stop',
- name: 'platinum_customer_info_stop',
- component: () => import('@/views/platinum/platinum_customer_info/list/stop-use/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/platinum_pick_query',
- name: 'platinum_pick_query',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'platinum_pick_query_tab' },
- children: [
- {
- path: '/platinum_pick_query/platinum_pick_query_tab',
- name: 'platinum_pick_query_tab',
- component: () => import('@/views/platinum/platinum_pick_query/list/tab/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/platinum_recharge_withdrawal_review',
- name: 'platinum_recharge_withdrawal_review',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'platinum_recharge_review_tab' },
- children: [
- {
- path: '/platinum_withdrawal_review_tab/platinum_recharge_review_tab',
- name: 'platinum_recharge_review_tab',
- component: () => import('@/views/platinum/platinum_recharge_withdrawal_review/list/recharge/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/platinum_withdrawal_review_tab/platinum_withdrawal_review_tab',
- name: 'platinum_withdrawal_review_tab',
- component: () => import('@/views/platinum/platinum_recharge_withdrawal_review/list/withdrawal/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/platinum_fixed_investment_price_query',
- name: 'platinum_fixed_investment_price_query',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'platinum_fixed_investment_price_query_tab' },
- children: [
- {
- path: '/platinum_fixed_investment_price_query/platinum_fixed_investment_price_query_tab',
- name: 'platinum_fixed_investment_price_query_tab',
- component: () => import('@/views/platinum/platinum_fixed_investment_price_query/list/tab/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/platinum_fixed_investment_query',
- name: 'platinum_fixed_investment_query',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'platinum_fixed_investment_plan_query' },
- children: [
- {
- path: '/platinum_fixed_investment_plan_query/platinum_fixed_investment_plan_query',
- name: 'platinum_fixed_investment_plan_query',
- component: () => import('@/views/platinum/platinum_fixed_investment_query/list/plan/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/platinum_fixed_investment_plan_query/platinum_fixed_investment_flow_query',
- name: 'platinum_fixed_investment_flow_query',
- component: () => import('@/views/platinum/platinum_fixed_investment_query/list/flow/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/platinum_document_query',
- name: 'platinum_document_query',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'platinum_document_query_position' },
- children: [
- {
- path: '/platinum_document_query/platinum_document_query_position',
- name: 'platinum_document_query_position',
- component: () => import('@/views/platinum/platinum_document_query/list/position/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/platinum_document_query/platinum_document_query_order',
- name: 'platinum_document_query_order',
- component: () => import('@/views/platinum/platinum_document_query/list/order/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/platinum_document_query/platinum_document_query_waiting',
- name: 'platinum_document_query_waiting',
- component: () => import('@/views/platinum/platinum_document_query/list/waiting/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/platinum_document_query/platinum_document_query_success',
- name: 'platinum_document_query_success',
- component: () => import('@/views/platinum/platinum_document_query/list/success/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/platinum_financing_information',
- name: 'platinum_financing_information',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'platinum_financing_information_tab' },
- children: [
- {
- path: '/platinum_financing_information/platinum_financing_information_tab',
- name: 'platinum_financing_information_tab',
- component: () => import('@/views/platinum/platinum_financing_information/list/tab/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/platinum_agents_and_stores',
- name: 'platinum_agents_and_stores',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'platinum_agents_and_stores_tab' },
- children: [
- {
- path: '/platinum_agents_and_stores/platinum_agents_and_stores_tab',
- name: 'platinum_agents_and_stores_tab',
- component: () => import('@/views/platinum/platinum_agents_and_stores/list/tab/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/platinum_agreement',
- name: 'platinum_agreement',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'platinum_agreement_tab' },
- children: [
- {
- path: '/platinum_agreement/platinum_agreement_tab',
- name: 'platinum_agreement_tab',
- component: () => import('@/views/platinum/platinum_agreement/list/tab/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/platinum_capital_flow',
- name: 'platinum_capital_flow',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'platinum_capital_flow_tab' },
- children: [
- {
- path: '/platinum_capital_flow_tab/platinum_capital_flow_tab',
- name: 'platinum_capital_flow_tab',
- component: () => import('@/views/platinum/platinum_capital_flow/platinum_capital_flow_tab/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/platinum_promotion_report',
- name: 'platinum_promotion_report',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'platinum_promotion_report_tab' },
- children: [
- {
- path: '/platinum_promotion_report/platinum_promotion_report_tab',
- name: 'platinum_promotion_report_tab',
- component: () => import('@/views/platinum/platinum_promotion_report/platinum_promotion_report_tab/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/platinum_broker_management',
- name: 'platinum_broker_management',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: 'platinum_broker_management_normal_tab' },
- children: [
- {
- path: '/platinum_broker_management/platinum_broker_management_normal_tab',
- name: 'platinum_broker_management_normal_tab',
- component: () => import('@/views/platinum/platinum_broker_management/normal/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/platinum_broker_management/platinum_broker_management_waiting_tab',
- name: 'platinum_broker_management_waiting_tab',
- component: () => import('@/views/platinum/platinum_broker_management/waiting/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/platinum_broker_management/platinum_broker_management_refuse_tab',
- name: 'platinum_broker_management_refuse_tab',
- component: () => import('@/views/platinum/platinum_broker_management/refuse/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/spot_trade',
- name: 'spot_trade',
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: '"warehouse_receipt_trade' },
- children: [
- {
- path: '/spot_trade/warehouse_receipt_trade',
- name: 'warehouse_receipt_trade',
- component: () => import('@/views/market/spot_trade/warehouse_receipt_trade/index.vue'),
- meta: {
- requireAuth: true,
- },
- children: [
- {
- path: '/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_floating_price',
- name: 'warehouse_receipt_trade_floating_price',
- component: () => import('@/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_floating_price/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_price',
- name: 'warehouse_receipt_trade_price',
- component: () => import('@/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_price/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/spot_trade/capacity_pre_sale',
- name: 'capacity_pre_sale',
- component: () => import('@/views/market/spot_trade/capacity_pre_sale/index.vue'),
- meta: {
- requireAuth: true,
- },
- children: [
- {
- path: '/spot_trade/capacity_pre_sale/capacity_pre_sale_floating_price',
- name: 'capacity_pre_sale_floating_price',
- component: () => import('@/views/market/spot_trade/capacity_pre_sale/capacity_pre_sale_floating_price/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/spot_trade/capacity_pre_sale/capacity_pre_sale_price',
- name: 'capacity_pre_sale_price',
- component: () => import('@/views/market/spot_trade/capacity_pre_sale/capacity_pre_sale_price/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- ]
- },
- ],
- },
- {
- path: '/test',
- name: 'test',
- component: () => import('@/views/test/index.vue'),
- },
- {
- // VueRouter 匹配规则是从上往下 建议把*放最后
- path: '/:pathMatch(.*)*',
- name: '404',
- component: () => import('@/views/error-page/404.vue'),
- },
- ];
- const router = createRouter({
- history: createWebHashHistory(),
- routes,
- });
- // 路由拦截
- router.beforeEach((to, from, next) => {
- // 前往登录页时 直接走登出流程
- if (to.fullPath === '/login') {
- eventBus.$emit('logout');
- next();
- } else {
- // 前往其他页 判断是否是登录状态
- if (isLogin()) {
- return next();
- } else {
- if (!getLoadIsComplete()) { // 没有加载对应的资料,表示第一次启动项目
- console.log('to', to);
- const { ACCOUNT, PASSWORD } = to.query
- const name = to.name ? to.name : 'home'
- if (ACCOUNT && PASSWORD) {
- setLoadComplete(false)
- globalDataRefresh().then(() => {
- const { ACCOUNT, PASSWORD } = to.query
- login(ACCOUNT as string, PASSWORD as string, [], true).then(res => {
- setLoadComplete(true)
- localStorageUtil.setItem('loginAccount', ACCOUNT); // 缓存登录账号
- eventBus.$emit('loginSuccess', true);
- next({ name })
- }).catch(err => {
- // 异常需要跳转到错误页面,让用户手动重试
- console.log('err', err);
- })
- })
- } else { // 跳转到登录页面
- next()
- }
- } else { //
- next()
- }
- }
- }
- });
- export default router;
|