2
0

perf: 合并用户平台框架修改

This commit is contained in:
TsMask
2024-12-03 16:46:39 +08:00
parent 13ee5a3849
commit c6b0c60392
30 changed files with 631 additions and 874 deletions

View File

@@ -1,7 +1,7 @@
import { useRouter } from 'vue-router';
import type { RouteLocationRaw } from 'vue-router';
import type { RouteKey } from '@elegant-router/types';
import { router as globalRouter } from '@/router';
import type {RouteLocationRaw} from 'vue-router';
import {useRouter} from 'vue-router';
import type {RouteKey} from '@elegant-router/types';
import {router as globalRouter} from '@/router';
/**
* Router push
@@ -24,7 +24,7 @@ export function useRouterPush(inSetup = true) {
}
async function routerPushByKey(key: RouteKey, options?: RouterPushOptions) {
const { query, params } = options || {};
const {query, params} = options || {};
const routeLocation: RouteLocationRaw = {
name: key
@@ -53,7 +53,6 @@ export function useRouterPush(inSetup = true) {
*/
async function toLogin(loginModule?: UnionKey.LoginModule, redirectUrl?: string) {
const module = loginModule || 'pwd-login';
const options: RouterPushOptions = {
params: {
module
@@ -77,7 +76,7 @@ export function useRouterPush(inSetup = true) {
async function toggleLoginModule(module: UnionKey.LoginModule) {
const query = route.value.query as Record<string, string>;
return routerPushByKey('login', { query, params: { module } });
return routerPushByKey('login', {query, params: {module}});
}
/** Redirect from login */