perf: 合并用户平台框架修改
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user