Parcourir la source

文件目录优化

liucong il y a 4 ans
Parent
commit
7095dea432

+ 0 - 0
src/enums/enumsName.ts → src/common/constants/enumsName.ts


+ 0 - 0
src/enums/index.ts → src/common/constants/index.ts


+ 0 - 0
src/enums/routerName.ts → src/common/constants/routerName.ts


+ 50 - 41
src/router/index.ts

@@ -1,4 +1,4 @@
-import * as EnumType from '@/enums/routerName';
+import * as EnumType from '@/common/constants/routerName';
 import Layout from '@/layout/index.vue';
 import { isLogin } from '@/services/bus/login';
 import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
@@ -35,7 +35,6 @@ const routes: Array<RouteRecordRaw> = [
                 path: '/futures',
                 name: 'forward',
                 component: () => import('@/views/market/forward/index.vue'),
-
             },
             {
                 path: '/warehouse-trade',
@@ -47,16 +46,18 @@ const routes: Array<RouteRecordRaw> = [
                 name: 'custom_info',
                 component: () => import('@/views/information/custom/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
+                },
+                redirect: (to) => {
+                    return { name: 'custom_info_normal' };
                 },
-                redirect: to => { return { name: 'custom_info_normal' } },
                 children: [
                     {
                         path: '/custom_info/normal',
                         name: 'custom_info_normal',
                         component: () => import('@/views/information/custom/list/normal-use/index.vue'),
                         meta: {
-                            requireAuth: true
+                            requireAuth: true,
                         },
                     },
                     {
@@ -64,7 +65,7 @@ const routes: Array<RouteRecordRaw> = [
                         name: 'custom_info_disabled',
                         component: () => import('@/views/information/custom/list/stop-use/index.vue'),
                         meta: {
-                            requireAuth: true
+                            requireAuth: true,
                         },
                     },
                 ],
@@ -74,16 +75,18 @@ const routes: Array<RouteRecordRaw> = [
                 name: 'goods_info',
                 component: () => import('@/views/information/goods/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
+                },
+                redirect: (to) => {
+                    return { name: 'goods_info_spot' };
                 },
-                redirect: to => { return { name: 'goods_info_spot' } },
                 children: [
                     {
                         path: '/goods_info/spot',
                         name: 'goods_info_spot',
                         component: () => import('@/views/information/goods/list/spot-variety/index.vue'),
                         meta: {
-                            requireAuth: true
+                            requireAuth: true,
                         },
                     },
                     {
@@ -91,7 +94,7 @@ const routes: Array<RouteRecordRaw> = [
                         name: 'goods_info_hedge',
                         component: () => import('@/views/information/goods/list/hedging-variety/index.vue'),
                         meta: {
-                            requireAuth: true
+                            requireAuth: true,
                         },
                     },
                 ],
@@ -101,7 +104,7 @@ const routes: Array<RouteRecordRaw> = [
                 name: 'outaccount_status',
                 component: () => import('@/views/search/outaccount_status/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
                 },
             },
             {
@@ -109,7 +112,7 @@ const routes: Array<RouteRecordRaw> = [
                 name: 'inventory',
                 component: () => import('@/views/search/inventory/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
                 },
             },
             {
@@ -117,16 +120,18 @@ const routes: Array<RouteRecordRaw> = [
                 name: 'spot_contract',
                 component: () => import('@/views/information/spot-contract/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
+                },
+                redirect: (to) => {
+                    return { name: 'spot_contract_unsubmitted' };
                 },
-                redirect: to => { return { name: 'spot_contract_unsubmitted' } },
                 children: [
                     {
                         path: '/spot_contract/not-commit',
                         name: 'spot_contract_unsubmitted',
                         component: () => import('@/views/information/spot-contract/list/not-commit/index.vue'),
                         meta: {
-                            requireAuth: true
+                            requireAuth: true,
                         },
                     },
                     {
@@ -134,7 +139,7 @@ const routes: Array<RouteRecordRaw> = [
                         name: 'spot_contract_checkpending',
                         component: () => import('@/views/information/spot-contract/list/done/index.vue'),
                         meta: {
-                            requireAuth: true
+                            requireAuth: true,
                         },
                     },
                     {
@@ -142,7 +147,7 @@ const routes: Array<RouteRecordRaw> = [
                         name: 'spot_contract_performance',
                         component: () => import('@/views/information/spot-contract/list/peddding/index.vue'),
                         meta: {
-                            requireAuth: true
+                            requireAuth: true,
                         },
                     },
                     {
@@ -150,26 +155,28 @@ const routes: Array<RouteRecordRaw> = [
                         name: 'spot_contract_finished',
                         component: () => import('@/views/information/spot-contract/list/performance/index.vue'),
                         meta: {
-                            requireAuth: true
+                            requireAuth: true,
                         },
                     },
-                ]
+                ],
             },
             {
                 path: '/warehouse_info',
                 name: 'warehouse_info',
                 component: () => import('@/views/information/warehouse-info/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
+                },
+                redirect: (to) => {
+                    return { name: 'warehouse_info_normal' };
                 },
-                redirect: to => { return { name: 'warehouse_info_normal' } },
                 children: [
                     {
                         path: '/warehouse_info/normal',
                         name: 'warehouse_info_normal',
                         component: () => import('@/views/information/warehouse-info/list/normal-use/index.vue'),
                         meta: {
-                            requireAuth: true
+                            requireAuth: true,
                         },
                     },
                     {
@@ -177,17 +184,17 @@ const routes: Array<RouteRecordRaw> = [
                         name: 'warehouse_info_disabled',
                         component: () => import('@/views/information/warehouse-info/list/stop-use/index.vue'),
                         meta: {
-                            requireAuth: true
+                            requireAuth: true,
                         },
                     },
-                ]
+                ],
             },
             {
                 path: '/exposure',
                 name: 'exposure',
                 component: () => import('@/views/business/exposure/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
                 },
             },
             {
@@ -195,7 +202,7 @@ const routes: Array<RouteRecordRaw> = [
                 name: 'plan',
                 component: () => import('@/views/business/plan/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
                 },
             },
             {
@@ -203,16 +210,18 @@ const routes: Array<RouteRecordRaw> = [
                 name: 'purchase',
                 component: () => import('@/views/business/purchase/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
+                },
+                redirect: (to) => {
+                    return { name: EnumType.Purchase.realTime };
                 },
-                redirect: to => { return { name: EnumType.Purchase.realTime } },
                 children: [
                     {
                         path: '/purchase/forward',
                         name: EnumType.Purchase.forward,
                         component: () => import('@/views/business/purchase/list/forward/index.vue'),
                         meta: {
-                            requireAuth: true
+                            requireAuth: true,
                         },
                     },
                     {
@@ -220,7 +229,7 @@ const routes: Array<RouteRecordRaw> = [
                         name: EnumType.Purchase.history,
                         component: () => import('@/views/business/purchase/list/history/index.vue'),
                         meta: {
-                            requireAuth: true
+                            requireAuth: true,
                         },
                     },
                     {
@@ -228,7 +237,7 @@ const routes: Array<RouteRecordRaw> = [
                         name: EnumType.Purchase.realTime,
                         component: () => import('@/views/business/purchase/list/real-time/index.vue'),
                         meta: {
-                            requireAuth: true
+                            requireAuth: true,
                         },
                     },
                     {
@@ -236,17 +245,17 @@ const routes: Array<RouteRecordRaw> = [
                         name: EnumType.Purchase.spot,
                         component: () => import('@/views/business/purchase/list/spot/index.vue'),
                         meta: {
-                            requireAuth: true
+                            requireAuth: true,
                         },
                     },
-                ]
+                ],
             },
             {
                 path: '/sell',
                 name: 'sell',
                 component: () => import('@/views/business/sell/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
                 },
             },
             {
@@ -254,7 +263,7 @@ const routes: Array<RouteRecordRaw> = [
                 name: 'business_review',
                 component: () => import('@/views/manage/business-review/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
                 },
             },
             {
@@ -262,7 +271,7 @@ const routes: Array<RouteRecordRaw> = [
                 name: 'finance_review',
                 component: () => import('@/views/manage/finance-review/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
                 },
             },
             {
@@ -270,7 +279,7 @@ const routes: Array<RouteRecordRaw> = [
                 name: 'inventory_review',
                 component: () => import('@/views/manage/inventory-review/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
                 },
             },
             {
@@ -278,7 +287,7 @@ const routes: Array<RouteRecordRaw> = [
                 name: 'exposure_report',
                 component: () => import('@/views/report/exposure-report/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
                 },
             },
             {
@@ -286,7 +295,7 @@ const routes: Array<RouteRecordRaw> = [
                 name: 'finance_report',
                 component: () => import('@/views/report/finance-report/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
                 },
             },
             {
@@ -294,7 +303,7 @@ const routes: Array<RouteRecordRaw> = [
                 name: 'inventory_report',
                 component: () => import('@/views/report/inventory-report/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
                 },
             },
             {
@@ -302,7 +311,7 @@ const routes: Array<RouteRecordRaw> = [
                 name: 'spot_report',
                 component: () => import('@/views/report/spot-report/index.vue'),
                 meta: {
-                    requireAuth: true
+                    requireAuth: true,
                 },
             },
         ],

+ 0 - 0
src/common/methods/router/index.ts → src/router/operation/index.ts


+ 1 - 1
src/services/socket/order/index.ts

@@ -1,5 +1,5 @@
 // 用户相关请求模块
-import { DelistingType, OperateType, OptionType, PriceType } from '@/enums/index';
+import { DelistingType, OperateType, OptionType, PriceType } from '@/common/constants/index';
 import APP from '@/services';
 import { getUserId } from '@/services/bus/account';
 import { getLongTypeLoginID } from '@/services/bus/login';