refactor(projects): 登录模块由query变更为动态路由params

This commit is contained in:
Soybean
2021-11-29 20:34:56 +08:00
parent f29106e480
commit 225c4fe022
8 changed files with 45 additions and 36 deletions

View File

@ -1,6 +1,6 @@
import type { Component } from 'vue';
import type { Router, RouteRecordRaw, RouteMeta } from 'vue-router';
import type { ImportedRouteModules } from '@/interface';
import type { ImportedRouteModules, LoginModuleType } from '@/interface';
interface SingleRouteConfig {
/** 路由 */
@ -107,3 +107,9 @@ export function getLoginRedirectUrl(router: Router) {
const redirectUrl = path === '/' ? undefined : path;
return redirectUrl;
}
/** 获取登录模块的正则字符串 */
export function getLoginModuleRegExp() {
const modules: LoginModuleType[] = ['pwd-login', 'code-login', 'register', 'reset-pwd', 'bind-wechat'];
return modules.join('|');
}