refactor(projects): 路由文件夹重构

This commit is contained in:
Soybean
2021-10-21 11:59:55 +08:00
parent b80c224664
commit b2854d57e8
28 changed files with 150 additions and 197 deletions

View File

@ -1,6 +1,6 @@
// import { computed } from 'vue';
// import { useRoute } from 'vue-router';
// import { RouteNameMap } from '@/router';
// import { ROUTE_NAME_MAP } from '@/utils';
export default function useRouteParam() {
// const route = useRoute();

View File

@ -1,7 +1,7 @@
import { computed } from 'vue';
import { useRoute } from 'vue-router';
import { EnumRoutePath } from '@/enum';
import { RouteNameMap } from '@/router';
import { ROUTE_NAME_MAP } from '@/utils';
export default function useRouteQuery() {
const route = useRoute();
@ -9,7 +9,7 @@ export default function useRouteQuery() {
/** 登录跳转链接 */
const loginRedirectUrl = computed(() => {
let url: EnumRoutePath | undefined;
if (route.name === RouteNameMap.get('login')) {
if (route.name === ROUTE_NAME_MAP.get('login')) {
url = (route.query?.redirectUrl as EnumRoutePath) || '';
}
return url;