refactor(projects): 登录重定向地址相关重构

This commit is contained in:
Soybean
2021-10-18 18:01:14 +08:00
parent 336c7766f9
commit 04008b63ee
11 changed files with 52 additions and 52 deletions

View File

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