mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-11-13 20:23:42 +08:00
feat(projects): 重构项目的TS类型架构,去除interface文件夹
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { computed } from 'vue';
|
||||
import { useAppStore, useThemeStore } from '@/store';
|
||||
import type { ThemeLayoutMode, GlobalHeaderProps } from '@/interface';
|
||||
|
||||
type LayoutHeaderProps = Record<ThemeLayoutMode, GlobalHeaderProps>;
|
||||
type LayoutHeaderProps = Record<EnumType.ThemeLayoutMode, GlobalHeaderProps>;
|
||||
|
||||
export function useBasicLayout() {
|
||||
const app = useAppStore();
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useRouter } from 'vue-router';
|
||||
import type { RouteLocationRaw } from 'vue-router';
|
||||
import { router as globalRouter, routeName } from '@/router';
|
||||
import type { LoginModuleKey } from '@/interface';
|
||||
|
||||
/**
|
||||
* 路由跳转
|
||||
@@ -43,8 +42,8 @@ export function useRouterPush(inSetup = true) {
|
||||
* @param loginModule - 展示的登录模块
|
||||
* @param redirectUrl - 重定向地址(登录成功后跳转的地址),默认undefined表示取当前地址为重定向地址
|
||||
*/
|
||||
function toLogin(loginModule?: LoginModuleKey, redirectUrl?: string) {
|
||||
const module: LoginModuleKey = loginModule || 'pwd-login';
|
||||
function toLogin(loginModule?: EnumType.LoginModuleKey, redirectUrl?: string) {
|
||||
const module: EnumType.LoginModuleKey = loginModule || 'pwd-login';
|
||||
const routeLocation: RouteLocationRaw = {
|
||||
name: routeName('login'),
|
||||
params: { module },
|
||||
@@ -58,7 +57,7 @@ export function useRouterPush(inSetup = true) {
|
||||
* 登录页切换其他模块
|
||||
* @param module - 切换后的登录模块
|
||||
*/
|
||||
function toLoginModule(module: LoginModuleKey) {
|
||||
function toLoginModule(module: EnumType.LoginModuleKey) {
|
||||
const { query } = route.value;
|
||||
routerPush({ name: routeName('login'), params: { module }, query });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user