zj
2024-06-03 cd10c1c4b723da0ae8496bf9c4f68a12e159fd97
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { createRouter, createWebHashHistory } from "vue-router";
import { forexRoutes } from "./forex";
import { loginRoutes } from "./login";
import { etfRoutes } from "./etf";
import { coinRoutes } from "./coin";
import { myRoutes } from "./my";
import { walletRoutes } from "./wallet";
import { orderRoutes } from "./order";
import { wealthRoutes } from "./wealth";
import { usStocksRoutes } from "./usStocks";
import { marketRoutes } from "./market";
import { forexTradeRoutes } from "./forexTrade";
import { useUserStore } from "@/store/user";
import { useLanguageStore } from "@/store/lang";
const routes = [
  ...forexRoutes,
  ...loginRoutes,
  ...etfRoutes,
  ...myRoutes,
  ...orderRoutes,
  ...walletRoutes,
  ...wealthRoutes,
  ...coinRoutes,
  ...usStocksRoutes,
  ...marketRoutes,
  ...forexTradeRoutes,
];
const router = createRouter({
  history: createWebHashHistory(),
  routes,
});
router.beforeEach((to, from, next) => {
  useUserStore();
  useLanguageStore();
  window.scrollTo(0, 0);
  next();
});
export default router;