refactor(projects): 代码优化

This commit is contained in:
Soybean
2022-04-13 23:45:15 +08:00
parent 46e1ae7825
commit e8b534b84e
15 changed files with 533 additions and 479 deletions

View File

@ -6,14 +6,14 @@ import { scrollBehavior } from './helpers';
import { createRouterGuard } from './guard';
const { VITE_HASH_ROUTE = 'false', VITE_BASE_URL } = import.meta.env;
const history = VITE_HASH_ROUTE === 'true' ? createWebHashHistory(VITE_BASE_URL) : createWebHistory(VITE_BASE_URL);
export const router = createRouter({
history,
history: VITE_HASH_ROUTE === 'true' ? createWebHashHistory(VITE_BASE_URL) : createWebHistory(VITE_BASE_URL),
routes: transformAuthRoutesToVueRoutes(constantRoutes),
scrollBehavior
});
/** setup vue router. - [安装vue路由] */
export async function setupRouter(app: App) {
app.use(router);
createRouterGuard(router);