| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238 |
- import { EnumRouterName } from '@/common/constants/enumRouterName';
- 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: EnumRouterName.spot_trade,
- component: Main,
- meta: {
- requireAuth: true,
- },
- redirect: { name: EnumRouterName.warehouse_receipt_trade, },
- children: [
- {
- path: '/spot_trade/warehouse_receipt_trade',
- name: EnumRouterName.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: EnumRouterName.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: EnumRouterName.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/warehouse_pre_sale',
- name: EnumRouterName.warehouse_pre_sale,
- component: () => import('@/views/market/spot_trade/warehouse_pre_sale/index.vue'),
- meta: {
- requireAuth: true,
- },
- children: [
- {
- path: '/spot_trade/warehouse_pre_sale/warehouse_pre_sale_floating_price',
- name: EnumRouterName.warehouse_pre_sale_floating_price,
- component: () => import('@/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_floating_price/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/spot_trade/warehouse_pre_sale/warehouse_pre_sale_price',
- name: EnumRouterName.warehouse_pre_sale_price,
- component: () => import('@/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_price/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- ]
- },
- {
- path: '/search_document_records',
- name: EnumRouterName.search_document_records,
- component: Main,
- meta: {
- requireAuth: true,
- },
- // redirect: { name: EnumRouterName.search_document_records, },
- children: [
- {
- path: '/search_document_records/search_commodity_contract',
- name: EnumRouterName.search_commodity_contract,
- component: () => import('@/views/search/search_document_records/search_commodity_contract/index.vue'),
- meta: {
- requireAuth: true,
- },
- children: [
- {
- path: '/search_document_records/search_commodity_contract/search_document_records_contract_summary',
- name: EnumRouterName.search_document_records_contract_summary,
- component: () => import('@/views/search/search_document_records/search_commodity_contract/search_document_records_contract_summary/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/search_document_records/search_commodity_contract/search_document_records_commission_record',
- name: EnumRouterName.search_document_records_commission_record,
- component: () => import('@/views/search/search_document_records/search_commodity_contract/search_document_records_commission_record/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/search_document_records/search_commodity_contract/search_document_records_delivery_record',
- name: EnumRouterName.search_document_records_delivery_record,
- component: () => import('@/views/search/search_document_records/search_commodity_contract/search_document_records_delivery_record/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/search_document_records/search_document_records/search_document_records_transaction_record',
- name: EnumRouterName.search_document_records_transaction_record,
- component: () => import('@/views/search/search_document_records/search_commodity_contract/search_document_records_transaction_record/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/search_document_records/search_pre_sale_warehouse_receipt',
- name: EnumRouterName.search_pre_sale_warehouse_receipt,
- component: () => import('@/views/search/search_document_records/search_pre_sale_warehouse_receipt/index.vue'),
- meta: {
- requireAuth: true,
- },
- children: [
- {
- path: '/search_document_records/search_pre_sale_warehouse_receipt/search_pre_sale_warehouse_receipt_commission_record',
- name: EnumRouterName.search_pre_sale_warehouse_receipt_commission_record,
- component: () => import('@/views/search/search_document_records/search_pre_sale_warehouse_receipt/search_pre_sale_warehouse_receipt_commission_record/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/search_document_records/search_pre_sale_warehouse_receipt/search_pre_sale_warehouse_receipt_order_summary',
- name: EnumRouterName.search_pre_sale_warehouse_receipt_order_summary,
- component: () => import('@/views/search/search_document_records/search_pre_sale_warehouse_receipt/search_pre_sale_warehouse_receipt_order_summary/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/search_document_records/search_pre_sale_warehouse_receipt/search_pre_sale_warehouse_receipt_protocol_specified_record',
- name: EnumRouterName.search_pre_sale_warehouse_receipt_protocol_specified_record,
- component: () => import('@/views/search/search_document_records/search_pre_sale_warehouse_receipt/search_pre_sale_warehouse_receipt_protocol_specified_record/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/search_document_records/search_pre_sale_warehouse_receipt/search_pre_sale_warehouse_receipt_transaction_record',
- name: EnumRouterName.search_pre_sale_warehouse_receipt_transaction_record,
- component: () => import('@/views/search/search_document_records/search_pre_sale_warehouse_receipt/search_pre_sale_warehouse_receipt_transaction_record/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- {
- path: '/search_document_records/search_spot_warrant',
- name: EnumRouterName.search_spot_warrant,
- component: () => import('@/views/search/search_document_records/search_spot_warrant/index.vue'),
- meta: {
- requireAuth: true,
- },
- children: [
- {
- path: '/search_document_records/search_spot_warrant/search_spot_warrant_transaction_record',
- name: EnumRouterName.search_spot_warrant_transaction_record,
- component: () => import('@/views/search/search_document_records/search_spot_warrant/search_spot_warrant_transaction_record/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/search_document_records/search_spot_warrant/search_spot_warrant_protocol_specified_record',
- name: EnumRouterName.search_spot_warrant_protocol_specified_record,
- component: () => import('@/views/search/search_document_records/search_spot_warrant/search_spot_warrant_protocol_specified_record/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/search_document_records/search_spot_warrant/search_spot_warrant_listing_record',
- name: EnumRouterName.search_spot_warrant_listing_record,
- component: () => import('@/views/search/search_document_records/search_spot_warrant/search_spot_warrant_listing_record/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/search_document_records/search_spot_warrant/search_spot_warrant_warehouse_receipt_details',
- name: EnumRouterName.search_spot_warrant_warehouse_receipt_details,
- component: () => import('@/views/search/search_document_records/search_spot_warrant/search_spot_warrant_warehouse_receipt_details/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- ]
- },
- ]
- },
- {
- path: '/search_capital_flow',
- name: EnumRouterName.search_capital_flow,
- component: Main,
- meta: {
- requireAuth: true,
- },
- children: [
- {
- path: '/search_capital_flow/search_capital_flow_tab',
- name: EnumRouterName.search_capital_flow_tab,
- component: () => import('@/views/search/search_capital_flow/search_capital_flow_tab/index.vue'),
- meta: {
- requireAuth: true,
- },
- }
- ]
- },
- {
- path: '/search_financing_inquiry',
- name: EnumRouterName.search_financing_inquiry,
- component: Main,
- meta: {
- requireAuth: true,
- },
- children: [
- {
- path: '/search_financing_inquiry/search_financing_inquiry_apply_order',
- name: EnumRouterName.search_financing_inquiry_apply_order,
- component: () => import('@/views/search/search_financing_inquiry/search_financing_inquiry_apply_order/index.vue'),
- meta: {
- requireAuth: true,
- },
- },
- {
- path: '/search_financing_inquiry/search_financing_inquiry_contract',
- name: EnumRouterName.search_financing_inquiry_contract,
- component: () => import('@/views/search/search_financing_inquiry/search_financing_inquiry_contract/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;
|