index.ts 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238
  1. import { EnumRouterName } from '@/common/constants/enumRouterName';
  2. import { setLoadComplete } from '@/common/methods';
  3. import { getLoadIsComplete } from '@/common/methods/mixin';
  4. import Main from '@/layout/components/main.vue';
  5. import Layout from '@/layout/index.vue';
  6. import { globalDataRefresh } from '@/services/bus';
  7. import { isLogin, login } from '@/services/bus/login';
  8. import { localStorageUtil } from '@/utils/storage';
  9. import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
  10. import eventBus from '../utils/eventBus';
  11. const routes: Array<RouteRecordRaw> = [
  12. {
  13. path: '/login',
  14. name: 'login',
  15. component: () => import('@/views/account/login.vue'),
  16. },
  17. {
  18. path: '/logon',
  19. name: 'logon',
  20. component: () => import('@/views/account/logon.vue'),
  21. },
  22. {
  23. path: '/resetPassword',
  24. name: 'resetPassword',
  25. component: () => import('@/views/account/resetPassword.vue'),
  26. },
  27. {
  28. path: '/',
  29. component: Layout,
  30. props: true,
  31. redirect: '/login',
  32. children: [
  33. {
  34. path: '/home',
  35. name: 'home',
  36. component: () => import('@/views/home.vue'),
  37. },
  38. {
  39. path: '/futures',
  40. name: 'forward',
  41. component: () => import('@/views/market/forward/index.vue'),
  42. },
  43. {
  44. path: '/warehouse-trade',
  45. name: 'warehouseTrade',
  46. component: () => import('@/views/market/warehouseTrade/index.vue'),
  47. },
  48. {
  49. path: 'custom_info',
  50. name: 'custom_info',
  51. component: Main,
  52. meta: {
  53. requireAuth: true,
  54. },
  55. redirect: (to) => {
  56. return { name: 'custom_info_unsubmit' };
  57. },
  58. children: [
  59. {
  60. path: '/custom_info/custom_info_normal',
  61. name: 'custom_info_normal',
  62. component: () => import('@/views/information/custom/list/normal-use/index.vue'),
  63. meta: {
  64. requireAuth: true,
  65. },
  66. },
  67. {
  68. path: '/custom_info/custom_info_disabled',
  69. name: 'custom_info_disabled',
  70. component: () => import('@/views/information/custom/list/stop-use/index.vue'),
  71. meta: {
  72. requireAuth: true,
  73. },
  74. },
  75. {
  76. path: '/custom_info/custom_info_checkpending',
  77. name: 'custom_info_checkpending',
  78. component: () => import('@/views/information/custom/list/checkpending/index.vue'),
  79. meta: {
  80. requireAuth: true,
  81. },
  82. },
  83. {
  84. path: '/custom_info/custom_info_unsubmit',
  85. name: 'custom_info_unsubmit',
  86. component: () => import('@/views/information/custom/list/unsubmit/index.vue'),
  87. meta: {
  88. requireAuth: true,
  89. },
  90. },
  91. ],
  92. },
  93. {
  94. path: 'goods_info',
  95. name: 'goods_info',
  96. component: Main,
  97. meta: {
  98. requireAuth: true,
  99. },
  100. redirect: (to) => {
  101. return { name: 'goods_info_spot' };
  102. },
  103. children: [
  104. {
  105. path: '/goods_info/goods_info_spot',
  106. name: 'goods_info_spot',
  107. component: () => import('@/views/information/goods/list/spot-variety/index.vue'),
  108. meta: {
  109. requireAuth: true,
  110. },
  111. },
  112. {
  113. path: '/goods_info/goods_info_hedge',
  114. name: 'goods_info_hedge',
  115. component: () => import('@/views/information/goods/list/hedging-variety/index.vue'),
  116. meta: {
  117. requireAuth: true,
  118. },
  119. },
  120. ],
  121. },
  122. {
  123. path: '/spot_contract',
  124. name: 'spot_contract',
  125. component: Main,
  126. meta: {
  127. requireAuth: true,
  128. },
  129. redirect: (to) => {
  130. return { name: 'spot_contract_unsubmitted' };
  131. },
  132. children: [
  133. {
  134. path: '/spot_contract/spot_contract_unsubmitted',
  135. name: 'spot_contract_unsubmitted',
  136. component: () => import('@/views/information/spot-contract/list/unsubmitted/index.vue'),
  137. meta: {
  138. requireAuth: true,
  139. },
  140. },
  141. {
  142. path: '/spot_contract/spot_contract_checkpending',
  143. name: 'spot_contract_checkpending',
  144. component: () => import('@/views/information/spot-contract/list/checkpending/index.vue'),
  145. meta: {
  146. requireAuth: true,
  147. },
  148. },
  149. {
  150. path: '/spot_contract/spot_contract_performance',
  151. name: 'spot_contract_performance',
  152. component: () => import('@/views/information/spot-contract/list/performance/index.vue'),
  153. meta: {
  154. requireAuth: true,
  155. },
  156. },
  157. {
  158. path: '/spot_contract/spot_contract_finished',
  159. name: 'spot_contract_finished',
  160. component: () => import('@/views/information/spot-contract/list/finished/index.vue'),
  161. meta: {
  162. requireAuth: true,
  163. },
  164. },
  165. ],
  166. },
  167. {
  168. path: '/account_info',
  169. name: 'account_info',
  170. component: Main,
  171. meta: {
  172. requireAuth: true,
  173. },
  174. redirect: (to) => {
  175. return { name: 'account_info_business' };
  176. },
  177. children: [
  178. {
  179. path: '/account_info/account_info_business',
  180. name: 'account_info_business',
  181. component: () => import('@/views/information/account_info/list/account_info_business/index.vue'),
  182. meta: {
  183. requireAuth: true,
  184. },
  185. },
  186. {
  187. path: '/account_info/account_info_futures',
  188. name: 'account_info_futures',
  189. component: () => import('@/views/information/account_info/list/account_info_futures/index.vue'),
  190. meta: {
  191. requireAuth: true,
  192. },
  193. },
  194. {
  195. path: '/account_info/account_info_manager',
  196. name: 'account_info_manager',
  197. component: () => import('@/views/information/account_info/list/account_info_manager/index.vue'),
  198. meta: {
  199. requireAuth: true,
  200. },
  201. },
  202. {
  203. path: '/account_info/account_info_trade',
  204. name: 'account_info_trade',
  205. component: () => import('@/views/information/account_info/list/account_info_trade/index.vue'),
  206. meta: {
  207. requireAuth: true,
  208. },
  209. },
  210. ],
  211. },
  212. {
  213. path: '/warehouse_info',
  214. name: 'warehouse_info',
  215. component: Main,
  216. meta: {
  217. requireAuth: true,
  218. },
  219. redirect: (to) => {
  220. return { name: 'warehouse_info_normal' };
  221. },
  222. children: [
  223. {
  224. path: '/warehouse_info/warehouse_info_normal',
  225. name: 'warehouse_info_normal',
  226. component: () => import('@/views/information/warehouse-info/list/normal-use/index.vue'),
  227. meta: {
  228. requireAuth: true,
  229. },
  230. },
  231. {
  232. path: '/warehouse_info/warehouse_info_disabled',
  233. name: 'warehouse_info_disabled',
  234. component: () => import('@/views/information/warehouse-info/list/stop-use/index.vue'),
  235. meta: {
  236. requireAuth: true,
  237. },
  238. },
  239. ],
  240. },
  241. {
  242. path: '/outaccount_status',
  243. name: 'outaccount_status',
  244. component: () => import('@/views/search/outaccount_status/index.vue'),
  245. meta: {
  246. requireAuth: true,
  247. },
  248. },
  249. {
  250. path: '/inventory',
  251. name: 'inventory',
  252. component: Main,
  253. meta: {
  254. requireAuth: true,
  255. },
  256. redirect: (to) => {
  257. return { name: 'inventory_current' };
  258. },
  259. children: [
  260. {
  261. path: '/inventory/inventory_current',
  262. name: 'inventory_current',
  263. component: () => import('@/views/search/inventory/list/inventory_current/index.vue'),
  264. meta: {
  265. requireAuth: true,
  266. },
  267. },
  268. {
  269. path: '/inventory/inventory_applyrecord',
  270. name: 'inventory_applyrecord',
  271. component: () => import('@/views/search/inventory/list/inventory_applyrecord/index.vue'),
  272. meta: {
  273. requireAuth: true,
  274. },
  275. },
  276. ]
  277. },
  278. {
  279. path: '/purchase',
  280. name: 'purchase',
  281. component: Main,
  282. meta: {
  283. requireAuth: true,
  284. },
  285. redirect: { name: 'purchase_pending' },
  286. children: [
  287. {
  288. path: '/purchase/purchase_pending',
  289. name: 'purchase_pending',
  290. component: () => import('@/views/business/purchase/list/pending/index.vue'),
  291. meta: {
  292. requireAuth: true,
  293. },
  294. },
  295. {
  296. path: '/purchase/purchase_performance',
  297. name: 'purchase_performance',
  298. component: () => import('@/views/business/purchase/list/performance/index.vue'),
  299. meta: {
  300. requireAuth: true,
  301. },
  302. },
  303. {
  304. path: '/purchase/purchase_all',
  305. name: 'purchase_all',
  306. component: () => import('@/views/business/purchase/list/all/index.vue'),
  307. meta: {
  308. requireAuth: true,
  309. },
  310. },
  311. ],
  312. },
  313. {
  314. path: '/sell',
  315. name: 'sell',
  316. component: Main,
  317. meta: {
  318. requireAuth: true,
  319. },
  320. redirect: { name: 'sell_pending' },
  321. children: [
  322. {
  323. path: '/sell/sell_pending',
  324. name: 'sell_pending',
  325. component: () => import('@/views/business/sell/list/pending/index.vue'),
  326. meta: {
  327. requireAuth: true,
  328. },
  329. },
  330. {
  331. path: '/sell/sell_performance',
  332. name: 'sell_performance',
  333. component: () => import('@/views/business/sell/list/performance/index.vue'),
  334. meta: {
  335. requireAuth: true,
  336. },
  337. },
  338. {
  339. path: '/sell/sell_all',
  340. name: 'sell_all',
  341. component: () => import('@/views/business/sell/list/all/index.vue'),
  342. meta: {
  343. requireAuth: true,
  344. },
  345. },
  346. ],
  347. },
  348. {
  349. path: '/exposure',
  350. name: 'exposure',
  351. component: Main,
  352. meta: {
  353. requireAuth: true,
  354. },
  355. redirect: { name: 'exposure_realtime' },
  356. children: [
  357. {
  358. path: '/exposure/exposure_realtime',
  359. name: 'exposure_realtime',
  360. component: () => import('@/views/business/exposure/list/realTime/index.vue'),
  361. meta: {
  362. requireAuth: true,
  363. },
  364. },
  365. {
  366. path: '/exposure/exposure_spot',
  367. name: 'exposure_spot',
  368. component: () => import('@/views/business/exposure/list/spot/index.vue'),
  369. meta: {
  370. requireAuth: true,
  371. },
  372. },
  373. {
  374. path: '/exposure/exposure_futures',
  375. name: 'exposure_futures',
  376. component: () => import('@/views/business/exposure/list/futures/index.vue'),
  377. meta: {
  378. requireAuth: true,
  379. },
  380. },
  381. {
  382. path: '/exposure/exposure_history',
  383. name: 'exposure_history',
  384. component: () => import('@/views/business/exposure/list/history/index.vue'),
  385. meta: {
  386. requireAuth: true,
  387. },
  388. },
  389. ],
  390. },
  391. {
  392. path: '/plan',
  393. name: 'plan',
  394. component: Main,
  395. meta: {
  396. requireAuth: true,
  397. },
  398. redirect: { name: 'plan_uncommitted' },
  399. children: [
  400. {
  401. path: '/plan/plan_uncommitted',
  402. name: 'plan_uncommitted',
  403. component: () => import('@/views/business/plan/list/uncommitted/index.vue'),
  404. meta: {
  405. requireAuth: true,
  406. },
  407. },
  408. {
  409. path: '/plan/plan_audit',
  410. name: 'plan_audit',
  411. component: () => import('@/views/business/plan/list/audit/index.vue'),
  412. meta: {
  413. requireAuth: true,
  414. },
  415. },
  416. {
  417. path: '/plan/plan_running',
  418. name: 'plan_running',
  419. component: () => import('@/views/business/plan/list/running/index.vue'),
  420. meta: {
  421. requireAuth: true,
  422. },
  423. },
  424. ],
  425. },
  426. {
  427. path: 'review',
  428. name: 'business_review',
  429. component: Main,
  430. meta: {
  431. requireAuth: true,
  432. },
  433. redirect: { name: 'business_review_someprice' },
  434. children: [
  435. {
  436. path: '/business_review/business_review_someprice',
  437. name: 'business_review_someprice',
  438. component: () => import('@/views/manage/business-review/list/someprice/index.vue'),
  439. meta: {
  440. requireAuth: true,
  441. },
  442. },
  443. {
  444. path: '/business_review/business_review_settlement',
  445. name: 'business_review_settlement',
  446. component: () => import('@/views/manage/business-review/list/settlement/index.vue'),
  447. meta: {
  448. requireAuth: true,
  449. },
  450. },
  451. ]
  452. },
  453. {
  454. path: '/finance_review',
  455. name: 'finance_review',
  456. component: Main,
  457. meta: {
  458. requireAuth: true,
  459. },
  460. redirect: { name: 'finance_review_funds' },
  461. children: [
  462. {
  463. path: '/finance_review/finance_review_funds',
  464. name: 'finance_review_funds',
  465. component: () => import('@/views/manage/finance-review/list/funds/index.vue'),
  466. meta: {
  467. requireAuth: true,
  468. },
  469. },
  470. {
  471. path: '/finance_review/finance_review_invoice',
  472. name: 'finance_review_invoice',
  473. component: () => import('@/views/manage/finance-review/list/invoice/index.vue'),
  474. meta: {
  475. requireAuth: true,
  476. },
  477. },
  478. ]
  479. },
  480. {
  481. path: '/inventory_review',
  482. name: 'inventory_review',
  483. component: Main,
  484. meta: {
  485. requireAuth: true,
  486. },
  487. redirect: { name: 'inventory_review_checkin' },
  488. children: [
  489. {
  490. path: '/inventory_review/inventory_review_checkin',
  491. name: 'inventory_review_checkin',
  492. component: () => import('@/views/manage/inventory-review/list/checkin/index.vue'),
  493. meta: {
  494. requireAuth: true,
  495. },
  496. },
  497. {
  498. path: '/inventory_review/inventory_review_checkout',
  499. name: 'inventory_review_checkout',
  500. component: () => import('@/views/manage/inventory-review/list/checkout/index.vue'),
  501. meta: {
  502. requireAuth: true,
  503. },
  504. },
  505. ]
  506. },
  507. {
  508. path: '/exposure_report',
  509. name: 'exposure_report',
  510. component: Main,
  511. meta: {
  512. requireAuth: true,
  513. },
  514. redirect: { name: 'exposure_report_exposure' },
  515. children: [
  516. {
  517. path: '/exposure_report/exposure_report_exposure',
  518. name: 'exposure_report_exposure',
  519. component: () => import('@/views/report/exposure-report/list/exposure_report/index.vue'),
  520. meta: {
  521. requireAuth: true,
  522. },
  523. },
  524. ]
  525. },
  526. {
  527. path: '/finance_report',
  528. name: 'finance_report',
  529. component: Main,
  530. meta: {
  531. requireAuth: true,
  532. },
  533. redirect: { name: 'finance_report_finance' },
  534. children: [
  535. {
  536. path: '/finance_report/finance_report_finance',
  537. name: 'finance_report_finance',
  538. component: () => import('@/views/report/finance-report/list/finance_report_finance/index.vue'),
  539. meta: {
  540. requireAuth: true,
  541. },
  542. },
  543. ]
  544. },
  545. {
  546. path: '/inventory_report',
  547. name: 'inventory_report',
  548. component: Main,
  549. meta: {
  550. requireAuth: true,
  551. },
  552. redirect: { name: 'inventory_report_inventory_category' },
  553. children: [
  554. {
  555. path: '/inventory_report/inventory_report_inventory_category',
  556. name: 'inventory_report_inventory_category',
  557. component: () => import('@/views/report/inventory-report/list/category/index.vue'),
  558. meta: {
  559. requireAuth: true,
  560. },
  561. },
  562. {
  563. path: '/inventory_report/warehouse',
  564. name: 'inventory_report_warehouse',
  565. component: () => import('@/views/report/inventory-report/list/warehouse/index.vue'),
  566. meta: {
  567. requireAuth: true,
  568. },
  569. },
  570. ]
  571. },
  572. {
  573. path: '/spot_report',
  574. name: 'spot_report',
  575. component: Main,
  576. meta: {
  577. requireAuth: true,
  578. },
  579. redirect: { name: 'spot_report_spot' },
  580. children: [
  581. {
  582. path: '/spot_report/spot_report_spot',
  583. name: 'spot_report_spot',
  584. component: () => import('@/views/report/spot-report/list/spot_report/index.vue'),
  585. meta: {
  586. requireAuth: true,
  587. },
  588. },
  589. ]
  590. },
  591. {
  592. path: '/sum_pl_report',
  593. name: 'sum_pl_report',
  594. component: Main,
  595. meta: {
  596. requireAuth: true,
  597. },
  598. redirect: { name: 'sum_pl_report_sum_pl' },
  599. children: [
  600. {
  601. path: '/sum_pl_report/sum_pl_report_sum_pl',
  602. name: 'sum_pl_report_sum_pl',
  603. component: () => import('@/views/report/sum_pl_report/list/sum_pl_report/index.vue'),
  604. meta: {
  605. requireAuth: true,
  606. },
  607. },
  608. ]
  609. },
  610. {
  611. path: '/future_report',
  612. name: 'future_report',
  613. component: Main,
  614. meta: {
  615. requireAuth: true,
  616. },
  617. redirect: { name: 'future_report_future' },
  618. children: [
  619. {
  620. path: '/future_report/future_report_future',
  621. name: 'future_report_future',
  622. component: () => import('@/views/report/future_report/list/future_report/index.vue'),
  623. meta: {
  624. requireAuth: true,
  625. },
  626. },
  627. ]
  628. },
  629. {
  630. path: '/platinum_customer_info',
  631. name: 'platinum_customer_info',
  632. component: Main,
  633. meta: {
  634. requireAuth: true,
  635. },
  636. redirect: { name: 'platinum_custom_info_normal' },
  637. children: [
  638. {
  639. path: '/platinum_customer_info/platinum_custom_info_normal',
  640. name: 'platinum_custom_info_normal',
  641. component: () => import('@/views/platinum/platinum_customer_info/list/normal-use/index.vue'),
  642. meta: {
  643. requireAuth: true,
  644. },
  645. },
  646. {
  647. path: '/platinum_customer_info/platinum_customer_info_unsubmit',
  648. name: 'platinum_customer_info_unsubmit',
  649. component: () => import('@/views/platinum/platinum_customer_info/list/unsubmit/index.vue'),
  650. meta: {
  651. requireAuth: true,
  652. },
  653. },
  654. {
  655. path: '/platinum_customer_info/platinum_customer_info_stop',
  656. name: 'platinum_customer_info_stop',
  657. component: () => import('@/views/platinum/platinum_customer_info/list/stop-use/index.vue'),
  658. meta: {
  659. requireAuth: true,
  660. },
  661. },
  662. ]
  663. },
  664. {
  665. path: '/platinum_pick_query',
  666. name: 'platinum_pick_query',
  667. component: Main,
  668. meta: {
  669. requireAuth: true,
  670. },
  671. redirect: { name: 'platinum_pick_query_tab' },
  672. children: [
  673. {
  674. path: '/platinum_pick_query/platinum_pick_query_tab',
  675. name: 'platinum_pick_query_tab',
  676. component: () => import('@/views/platinum/platinum_pick_query/list/tab/index.vue'),
  677. meta: {
  678. requireAuth: true,
  679. },
  680. },
  681. ]
  682. },
  683. {
  684. path: '/platinum_recharge_withdrawal_review',
  685. name: 'platinum_recharge_withdrawal_review',
  686. component: Main,
  687. meta: {
  688. requireAuth: true,
  689. },
  690. redirect: { name: 'platinum_recharge_review_tab' },
  691. children: [
  692. {
  693. path: '/platinum_withdrawal_review_tab/platinum_recharge_review_tab',
  694. name: 'platinum_recharge_review_tab',
  695. component: () => import('@/views/platinum/platinum_recharge_withdrawal_review/list/recharge/index.vue'),
  696. meta: {
  697. requireAuth: true,
  698. },
  699. },
  700. {
  701. path: '/platinum_withdrawal_review_tab/platinum_withdrawal_review_tab',
  702. name: 'platinum_withdrawal_review_tab',
  703. component: () => import('@/views/platinum/platinum_recharge_withdrawal_review/list/withdrawal/index.vue'),
  704. meta: {
  705. requireAuth: true,
  706. },
  707. },
  708. ]
  709. },
  710. {
  711. path: '/platinum_fixed_investment_price_query',
  712. name: 'platinum_fixed_investment_price_query',
  713. component: Main,
  714. meta: {
  715. requireAuth: true,
  716. },
  717. redirect: { name: 'platinum_fixed_investment_price_query_tab' },
  718. children: [
  719. {
  720. path: '/platinum_fixed_investment_price_query/platinum_fixed_investment_price_query_tab',
  721. name: 'platinum_fixed_investment_price_query_tab',
  722. component: () => import('@/views/platinum/platinum_fixed_investment_price_query/list/tab/index.vue'),
  723. meta: {
  724. requireAuth: true,
  725. },
  726. },
  727. ]
  728. },
  729. {
  730. path: '/platinum_fixed_investment_query',
  731. name: 'platinum_fixed_investment_query',
  732. component: Main,
  733. meta: {
  734. requireAuth: true,
  735. },
  736. redirect: { name: 'platinum_fixed_investment_plan_query' },
  737. children: [
  738. {
  739. path: '/platinum_fixed_investment_plan_query/platinum_fixed_investment_plan_query',
  740. name: 'platinum_fixed_investment_plan_query',
  741. component: () => import('@/views/platinum/platinum_fixed_investment_query/list/plan/index.vue'),
  742. meta: {
  743. requireAuth: true,
  744. },
  745. },
  746. {
  747. path: '/platinum_fixed_investment_plan_query/platinum_fixed_investment_flow_query',
  748. name: 'platinum_fixed_investment_flow_query',
  749. component: () => import('@/views/platinum/platinum_fixed_investment_query/list/flow/index.vue'),
  750. meta: {
  751. requireAuth: true,
  752. },
  753. },
  754. ]
  755. },
  756. {
  757. path: '/platinum_document_query',
  758. name: 'platinum_document_query',
  759. component: Main,
  760. meta: {
  761. requireAuth: true,
  762. },
  763. redirect: { name: 'platinum_document_query_position' },
  764. children: [
  765. {
  766. path: '/platinum_document_query/platinum_document_query_position',
  767. name: 'platinum_document_query_position',
  768. component: () => import('@/views/platinum/platinum_document_query/list/position/index.vue'),
  769. meta: {
  770. requireAuth: true,
  771. },
  772. },
  773. {
  774. path: '/platinum_document_query/platinum_document_query_order',
  775. name: 'platinum_document_query_order',
  776. component: () => import('@/views/platinum/platinum_document_query/list/order/index.vue'),
  777. meta: {
  778. requireAuth: true,
  779. },
  780. },
  781. {
  782. path: '/platinum_document_query/platinum_document_query_waiting',
  783. name: 'platinum_document_query_waiting',
  784. component: () => import('@/views/platinum/platinum_document_query/list/waiting/index.vue'),
  785. meta: {
  786. requireAuth: true,
  787. },
  788. },
  789. {
  790. path: '/platinum_document_query/platinum_document_query_success',
  791. name: 'platinum_document_query_success',
  792. component: () => import('@/views/platinum/platinum_document_query/list/success/index.vue'),
  793. meta: {
  794. requireAuth: true,
  795. },
  796. },
  797. ]
  798. },
  799. {
  800. path: '/platinum_financing_information',
  801. name: 'platinum_financing_information',
  802. component: Main,
  803. meta: {
  804. requireAuth: true,
  805. },
  806. redirect: { name: 'platinum_financing_information_tab' },
  807. children: [
  808. {
  809. path: '/platinum_financing_information/platinum_financing_information_tab',
  810. name: 'platinum_financing_information_tab',
  811. component: () => import('@/views/platinum/platinum_financing_information/list/tab/index.vue'),
  812. meta: {
  813. requireAuth: true,
  814. },
  815. },
  816. ]
  817. },
  818. {
  819. path: '/platinum_agents_and_stores',
  820. name: 'platinum_agents_and_stores',
  821. component: Main,
  822. meta: {
  823. requireAuth: true,
  824. },
  825. redirect: { name: 'platinum_agents_and_stores_tab' },
  826. children: [
  827. {
  828. path: '/platinum_agents_and_stores/platinum_agents_and_stores_tab',
  829. name: 'platinum_agents_and_stores_tab',
  830. component: () => import('@/views/platinum/platinum_agents_and_stores/list/tab/index.vue'),
  831. meta: {
  832. requireAuth: true,
  833. },
  834. },
  835. ]
  836. },
  837. {
  838. path: '/platinum_agreement',
  839. name: 'platinum_agreement',
  840. component: Main,
  841. meta: {
  842. requireAuth: true,
  843. },
  844. redirect: { name: 'platinum_agreement_tab' },
  845. children: [
  846. {
  847. path: '/platinum_agreement/platinum_agreement_tab',
  848. name: 'platinum_agreement_tab',
  849. component: () => import('@/views/platinum/platinum_agreement/list/tab/index.vue'),
  850. meta: {
  851. requireAuth: true,
  852. },
  853. },
  854. ]
  855. },
  856. {
  857. path: '/platinum_capital_flow',
  858. name: 'platinum_capital_flow',
  859. component: Main,
  860. meta: {
  861. requireAuth: true,
  862. },
  863. redirect: { name: 'platinum_capital_flow_tab' },
  864. children: [
  865. {
  866. path: '/platinum_capital_flow_tab/platinum_capital_flow_tab',
  867. name: 'platinum_capital_flow_tab',
  868. component: () => import('@/views/platinum/platinum_capital_flow/platinum_capital_flow_tab/index.vue'),
  869. meta: {
  870. requireAuth: true,
  871. },
  872. },
  873. ]
  874. },
  875. {
  876. path: '/platinum_promotion_report',
  877. name: 'platinum_promotion_report',
  878. component: Main,
  879. meta: {
  880. requireAuth: true,
  881. },
  882. redirect: { name: 'platinum_promotion_report_tab' },
  883. children: [
  884. {
  885. path: '/platinum_promotion_report/platinum_promotion_report_tab',
  886. name: 'platinum_promotion_report_tab',
  887. component: () => import('@/views/platinum/platinum_promotion_report/platinum_promotion_report_tab/index.vue'),
  888. meta: {
  889. requireAuth: true,
  890. },
  891. },
  892. ]
  893. },
  894. {
  895. path: '/platinum_broker_management',
  896. name: 'platinum_broker_management',
  897. component: Main,
  898. meta: {
  899. requireAuth: true,
  900. },
  901. redirect: { name: 'platinum_broker_management_normal_tab' },
  902. children: [
  903. {
  904. path: '/platinum_broker_management/platinum_broker_management_normal_tab',
  905. name: 'platinum_broker_management_normal_tab',
  906. component: () => import('@/views/platinum/platinum_broker_management/normal/index.vue'),
  907. meta: {
  908. requireAuth: true,
  909. },
  910. },
  911. {
  912. path: '/platinum_broker_management/platinum_broker_management_waiting_tab',
  913. name: 'platinum_broker_management_waiting_tab',
  914. component: () => import('@/views/platinum/platinum_broker_management/waiting/index.vue'),
  915. meta: {
  916. requireAuth: true,
  917. },
  918. },
  919. {
  920. path: '/platinum_broker_management/platinum_broker_management_refuse_tab',
  921. name: 'platinum_broker_management_refuse_tab',
  922. component: () => import('@/views/platinum/platinum_broker_management/refuse/index.vue'),
  923. meta: {
  924. requireAuth: true,
  925. },
  926. },
  927. ]
  928. },
  929. {
  930. path: '/spot_trade',
  931. name: EnumRouterName.spot_trade,
  932. component: Main,
  933. meta: {
  934. requireAuth: true,
  935. },
  936. redirect: { name: EnumRouterName.warehouse_receipt_trade, },
  937. children: [
  938. {
  939. path: '/spot_trade/warehouse_receipt_trade',
  940. name: EnumRouterName.warehouse_receipt_trade,
  941. component: () => import('@/views/market/spot_trade/warehouse_receipt_trade/index.vue'),
  942. meta: {
  943. requireAuth: true,
  944. },
  945. children: [
  946. {
  947. path: '/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_floating_price',
  948. name: EnumRouterName.warehouse_receipt_trade_floating_price,
  949. component: () => import('@/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_floating_price/index.vue'),
  950. meta: {
  951. requireAuth: true,
  952. },
  953. },
  954. {
  955. path: '/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_price',
  956. name: EnumRouterName.warehouse_receipt_trade_price,
  957. component: () => import('@/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_price/index.vue'),
  958. meta: {
  959. requireAuth: true,
  960. },
  961. },
  962. ]
  963. },
  964. {
  965. path: '/spot_trade/warehouse_pre_sale',
  966. name: EnumRouterName.warehouse_pre_sale,
  967. component: () => import('@/views/market/spot_trade/warehouse_pre_sale/index.vue'),
  968. meta: {
  969. requireAuth: true,
  970. },
  971. children: [
  972. {
  973. path: '/spot_trade/warehouse_pre_sale/warehouse_pre_sale_floating_price',
  974. name: EnumRouterName.warehouse_pre_sale_floating_price,
  975. component: () => import('@/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_floating_price/index.vue'),
  976. meta: {
  977. requireAuth: true,
  978. },
  979. },
  980. {
  981. path: '/spot_trade/warehouse_pre_sale/warehouse_pre_sale_price',
  982. name: EnumRouterName.warehouse_pre_sale_price,
  983. component: () => import('@/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_price/index.vue'),
  984. meta: {
  985. requireAuth: true,
  986. },
  987. },
  988. ]
  989. },
  990. ]
  991. },
  992. {
  993. path: '/search_document_records',
  994. name: EnumRouterName.search_document_records,
  995. component: Main,
  996. meta: {
  997. requireAuth: true,
  998. },
  999. // redirect: { name: EnumRouterName.search_document_records, },
  1000. children: [
  1001. {
  1002. path: '/search_document_records/search_commodity_contract',
  1003. name: EnumRouterName.search_commodity_contract,
  1004. component: () => import('@/views/search/search_document_records/search_commodity_contract/index.vue'),
  1005. meta: {
  1006. requireAuth: true,
  1007. },
  1008. children: [
  1009. {
  1010. path: '/search_document_records/search_commodity_contract/search_document_records_contract_summary',
  1011. name: EnumRouterName.search_document_records_contract_summary,
  1012. component: () => import('@/views/search/search_document_records/search_commodity_contract/search_document_records_contract_summary/index.vue'),
  1013. meta: {
  1014. requireAuth: true,
  1015. },
  1016. },
  1017. {
  1018. path: '/search_document_records/search_commodity_contract/search_document_records_commission_record',
  1019. name: EnumRouterName.search_document_records_commission_record,
  1020. component: () => import('@/views/search/search_document_records/search_commodity_contract/search_document_records_commission_record/index.vue'),
  1021. meta: {
  1022. requireAuth: true,
  1023. },
  1024. },
  1025. {
  1026. path: '/search_document_records/search_commodity_contract/search_document_records_delivery_record',
  1027. name: EnumRouterName.search_document_records_delivery_record,
  1028. component: () => import('@/views/search/search_document_records/search_commodity_contract/search_document_records_delivery_record/index.vue'),
  1029. meta: {
  1030. requireAuth: true,
  1031. },
  1032. },
  1033. {
  1034. path: '/search_document_records/search_document_records/search_document_records_transaction_record',
  1035. name: EnumRouterName.search_document_records_transaction_record,
  1036. component: () => import('@/views/search/search_document_records/search_commodity_contract/search_document_records_transaction_record/index.vue'),
  1037. meta: {
  1038. requireAuth: true,
  1039. },
  1040. },
  1041. ]
  1042. },
  1043. {
  1044. path: '/search_document_records/search_pre_sale_warehouse_receipt',
  1045. name: EnumRouterName.search_pre_sale_warehouse_receipt,
  1046. component: () => import('@/views/search/search_document_records/search_pre_sale_warehouse_receipt/index.vue'),
  1047. meta: {
  1048. requireAuth: true,
  1049. },
  1050. children: [
  1051. {
  1052. path: '/search_document_records/search_pre_sale_warehouse_receipt/search_pre_sale_warehouse_receipt_commission_record',
  1053. name: EnumRouterName.search_pre_sale_warehouse_receipt_commission_record,
  1054. component: () => import('@/views/search/search_document_records/search_pre_sale_warehouse_receipt/search_pre_sale_warehouse_receipt_commission_record/index.vue'),
  1055. meta: {
  1056. requireAuth: true,
  1057. },
  1058. },
  1059. {
  1060. path: '/search_document_records/search_pre_sale_warehouse_receipt/search_pre_sale_warehouse_receipt_order_summary',
  1061. name: EnumRouterName.search_pre_sale_warehouse_receipt_order_summary,
  1062. component: () => import('@/views/search/search_document_records/search_pre_sale_warehouse_receipt/search_pre_sale_warehouse_receipt_order_summary/index.vue'),
  1063. meta: {
  1064. requireAuth: true,
  1065. },
  1066. },
  1067. {
  1068. path: '/search_document_records/search_pre_sale_warehouse_receipt/search_pre_sale_warehouse_receipt_protocol_specified_record',
  1069. name: EnumRouterName.search_pre_sale_warehouse_receipt_protocol_specified_record,
  1070. component: () => import('@/views/search/search_document_records/search_pre_sale_warehouse_receipt/search_pre_sale_warehouse_receipt_protocol_specified_record/index.vue'),
  1071. meta: {
  1072. requireAuth: true,
  1073. },
  1074. },
  1075. {
  1076. path: '/search_document_records/search_pre_sale_warehouse_receipt/search_pre_sale_warehouse_receipt_transaction_record',
  1077. name: EnumRouterName.search_pre_sale_warehouse_receipt_transaction_record,
  1078. component: () => import('@/views/search/search_document_records/search_pre_sale_warehouse_receipt/search_pre_sale_warehouse_receipt_transaction_record/index.vue'),
  1079. meta: {
  1080. requireAuth: true,
  1081. },
  1082. },
  1083. ]
  1084. },
  1085. {
  1086. path: '/search_document_records/search_spot_warrant',
  1087. name: EnumRouterName.search_spot_warrant,
  1088. component: () => import('@/views/search/search_document_records/search_spot_warrant/index.vue'),
  1089. meta: {
  1090. requireAuth: true,
  1091. },
  1092. children: [
  1093. {
  1094. path: '/search_document_records/search_spot_warrant/search_spot_warrant_transaction_record',
  1095. name: EnumRouterName.search_spot_warrant_transaction_record,
  1096. component: () => import('@/views/search/search_document_records/search_spot_warrant/search_spot_warrant_transaction_record/index.vue'),
  1097. meta: {
  1098. requireAuth: true,
  1099. },
  1100. },
  1101. {
  1102. path: '/search_document_records/search_spot_warrant/search_spot_warrant_protocol_specified_record',
  1103. name: EnumRouterName.search_spot_warrant_protocol_specified_record,
  1104. component: () => import('@/views/search/search_document_records/search_spot_warrant/search_spot_warrant_protocol_specified_record/index.vue'),
  1105. meta: {
  1106. requireAuth: true,
  1107. },
  1108. },
  1109. {
  1110. path: '/search_document_records/search_spot_warrant/search_spot_warrant_listing_record',
  1111. name: EnumRouterName.search_spot_warrant_listing_record,
  1112. component: () => import('@/views/search/search_document_records/search_spot_warrant/search_spot_warrant_listing_record/index.vue'),
  1113. meta: {
  1114. requireAuth: true,
  1115. },
  1116. },
  1117. {
  1118. path: '/search_document_records/search_spot_warrant/search_spot_warrant_warehouse_receipt_details',
  1119. name: EnumRouterName.search_spot_warrant_warehouse_receipt_details,
  1120. component: () => import('@/views/search/search_document_records/search_spot_warrant/search_spot_warrant_warehouse_receipt_details/index.vue'),
  1121. meta: {
  1122. requireAuth: true,
  1123. },
  1124. },
  1125. ]
  1126. },
  1127. ]
  1128. },
  1129. {
  1130. path: '/search_capital_flow',
  1131. name: EnumRouterName.search_capital_flow,
  1132. component: Main,
  1133. meta: {
  1134. requireAuth: true,
  1135. },
  1136. children: [
  1137. {
  1138. path: '/search_capital_flow/search_capital_flow_tab',
  1139. name: EnumRouterName.search_capital_flow_tab,
  1140. component: () => import('@/views/search/search_capital_flow/search_capital_flow_tab/index.vue'),
  1141. meta: {
  1142. requireAuth: true,
  1143. },
  1144. }
  1145. ]
  1146. },
  1147. {
  1148. path: '/search_financing_inquiry',
  1149. name: EnumRouterName.search_financing_inquiry,
  1150. component: Main,
  1151. meta: {
  1152. requireAuth: true,
  1153. },
  1154. children: [
  1155. {
  1156. path: '/search_financing_inquiry/search_financing_inquiry_apply_order',
  1157. name: EnumRouterName.search_financing_inquiry_apply_order,
  1158. component: () => import('@/views/search/search_financing_inquiry/search_financing_inquiry_apply_order/index.vue'),
  1159. meta: {
  1160. requireAuth: true,
  1161. },
  1162. },
  1163. {
  1164. path: '/search_financing_inquiry/search_financing_inquiry_contract',
  1165. name: EnumRouterName.search_financing_inquiry_contract,
  1166. component: () => import('@/views/search/search_financing_inquiry/search_financing_inquiry_contract/index.vue'),
  1167. meta: {
  1168. requireAuth: true,
  1169. },
  1170. }
  1171. ]
  1172. },
  1173. ],
  1174. },
  1175. {
  1176. path: '/test',
  1177. name: 'test',
  1178. component: () => import('@/views/test/index.vue'),
  1179. },
  1180. {
  1181. // VueRouter 匹配规则是从上往下 建议把*放最后
  1182. path: '/:pathMatch(.*)*',
  1183. name: '404',
  1184. component: () => import('@/views/error-page/404.vue'),
  1185. },
  1186. ];
  1187. const router = createRouter({
  1188. history: createWebHashHistory(),
  1189. routes,
  1190. });
  1191. // 路由拦截
  1192. router.beforeEach((to, from, next) => {
  1193. // 前往登录页时 直接走登出流程
  1194. if (to.fullPath === '/login') {
  1195. eventBus.$emit('logout');
  1196. next();
  1197. } else {
  1198. // 前往其他页 判断是否是登录状态
  1199. if (isLogin()) {
  1200. return next();
  1201. } else {
  1202. if (!getLoadIsComplete()) { // 没有加载对应的资料,表示第一次启动项目
  1203. console.log('to', to);
  1204. const { ACCOUNT, PASSWORD } = to.query
  1205. const name = to.name ? to.name : 'home'
  1206. if (ACCOUNT && PASSWORD) {
  1207. setLoadComplete(false)
  1208. globalDataRefresh().then(() => {
  1209. const { ACCOUNT, PASSWORD } = to.query
  1210. login(ACCOUNT as string, PASSWORD as string, [], true).then(res => {
  1211. setLoadComplete(true)
  1212. localStorageUtil.setItem('loginAccount', ACCOUNT); // 缓存登录账号
  1213. eventBus.$emit('loginSuccess', true);
  1214. next({ name })
  1215. }).catch(err => {
  1216. // 异常需要跳转到错误页面,让用户手动重试
  1217. console.log('err', err);
  1218. })
  1219. })
  1220. } else { // 跳转到登录页面
  1221. next()
  1222. }
  1223. } else { //
  1224. next()
  1225. }
  1226. }
  1227. }
  1228. });
  1229. export default router;