refactor(projects): 代码优化

This commit is contained in:
Soybean
2022-07-10 00:41:35 +08:00
parent da407b6653
commit b60db89801
17 changed files with 31 additions and 34 deletions

View File

@@ -5,10 +5,10 @@ import { constantRoutes } from './routes';
import { scrollBehavior } from './helpers';
import { createRouterGuard } from './guard';
const { VITE_HASH_ROUTE = 'false', VITE_BASE_URL } = import.meta.env;
const { VITE_HASH_ROUTE = '0', VITE_BASE_URL } = import.meta.env;
export const router = createRouter({
history: VITE_HASH_ROUTE === 'true' ? createWebHashHistory(VITE_BASE_URL) : createWebHistory(VITE_BASE_URL),
history: VITE_HASH_ROUTE === '1' ? createWebHashHistory(VITE_BASE_URL) : createWebHistory(VITE_BASE_URL),
routes: transformAuthRoutesToVueRoutes(constantRoutes),
scrollBehavior
});