修改前端导入规范.

This commit is contained in:
lijiahang
2023-10-25 10:26:14 +08:00
parent eb2c8eb719
commit d3825ab5b2
125 changed files with 277 additions and 231 deletions

View File

@@ -1,5 +1,5 @@
import type { AppState } from './types';
import { defineStore } from 'pinia';
import { AppState } from './types';
const defaultConfig: AppState = {
// 应用设置

View File

@@ -1,5 +1,5 @@
import type { CacheState } from './types';
import { defineStore } from 'pinia';
import { CacheState } from './types';
export type CacheType = 'menus' | 'roles' | 'hostTags' | 'hostKeys' | 'hostIdentities' | 'dictKeys' | string

View File

@@ -1,9 +1,9 @@
import { MenuQueryResponse } from '@/api/system/menu';
import { RoleQueryResponse } from '@/api/user/role';
import { TagQueryResponse } from '@/api/meta/tag';
import { HostKeyQueryResponse } from '@/api/asset/host-key';
import { HostIdentityQueryResponse } from '@/api/asset/host-identity';
import { DictKeyQueryResponse } from '@/api/system/dict-key';
import type { MenuQueryResponse } from '@/api/system/menu';
import type { RoleQueryResponse } from '@/api/user/role';
import type { TagQueryResponse } from '@/api/meta/tag';
import type { HostKeyQueryResponse } from '@/api/asset/host-key';
import type { HostIdentityQueryResponse } from '@/api/asset/host-identity';
import type { DictKeyQueryResponse } from '@/api/system/dict-key';
export interface CacheState {
menus: MenuQueryResponse[];

View File

@@ -1,8 +1,8 @@
import type { RouteRecordNormalized } from 'vue-router';
import type { MenuState } from './types';
import { defineStore } from 'pinia';
import { Notification } from '@arco-design/web-vue';
import type { RouteRecordNormalized } from 'vue-router';
import { getMenuList } from '@/api/user/auth';
import { MenuState } from './types';
import router from '@/router';
export default defineStore('menu', {

View File

@@ -1,7 +1,7 @@
import type { TabBarState, TagProps } from './types';
import { defineStore } from 'pinia';
import { DEFAULT_ROUTE_NAME, DEFAULT_TAB } from '@/router/constants';
import { isString } from '@/utils/is';
import { TabBarState, TagProps } from './types';
export default defineStore('tabBar', {
state: (): TabBarState => ({

View File

@@ -1,5 +1,5 @@
import type { TipsState } from './types';
import { defineStore } from 'pinia';
import { TipsState } from './types';
import { setTipsTipped } from '@/api/user/tips';
export default defineStore('tips', {

View File

@@ -1,9 +1,10 @@
import type { UserState } from './types';
import type { LoginRequest } from '@/api/user/auth';
import { defineStore } from 'pinia';
import { getUserPermission, login as userLogin, LoginRequest, logout as userLogout } from '@/api/user/auth';
import { getUserPermission, login as userLogin, logout as userLogout } from '@/api/user/auth';
import { clearToken, setToken } from '@/utils/auth';
import { md5 } from '@/utils';
import { removeRouteListener } from '@/utils/route-listener';
import { UserState } from './types';
import { useAppStore, useMenuStore, useTabBarStore, useTipsStore } from '@/store';
export default defineStore('user', {