Ver Fonte

修改 融资融货 菜单位置

li.shaoyi há 3 anos atrás
pai
commit
98ce02fd5a
1 ficheiros alterados com 14 adições e 11 exclusões
  1. 14 11
      src/services/go/commonService/index.ts

+ 14 - 11
src/services/go/commonService/index.ts

@@ -105,17 +105,20 @@ export function GetPCMenus(): Promise<string> {
             const first = res.find((e) => e.code === 'market');
             const second = first?.children.find((e) => e.code === 'spot_trade');
 
-            second?.children.push({
-                code: 'spot_trade_advertisement',
-                isshow: true,
-                rulekey: 'spot_trade_advertisement',
-                sort: 0,
-                title: '融资融货',
-                type: 1,
-                url: '',
-                remark: '',
-                children: []
-            })
+            if (second) {
+                const lastIndex = second.children.length - 1;
+                second.children.splice(lastIndex, 0, {
+                    code: 'spot_trade_advertisement',
+                    isshow: true,
+                    rulekey: 'spot_trade_advertisement',
+                    sort: 0,
+                    title: '融资融货',
+                    type: 1,
+                    url: '',
+                    remark: '',
+                    children: []
+                })
+            }
 
             APP.set('menus', res);
             console.log('交易端菜单', res);