mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-11-10 18:53:44 +08:00
refactor(projects): 抽离格式化相关依赖配置
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { EnumStorageKey } from '@/enum';
|
||||
import { setLocal, getLocal, removeLocal } from '../storage';
|
||||
import { getLocal, removeLocal, setLocal } from '../storage';
|
||||
|
||||
/** 设置token */
|
||||
export function setToken(token: string) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Ref } from 'vue';
|
||||
import type { FormItemRule } from 'naive-ui';
|
||||
import { REGEXP_PHONE, REGEXP_PWD, REGEXP_CODE_SIX, REGEXP_EMAIL } from '@/config';
|
||||
import { REGEXP_CODE_SIX, REGEXP_EMAIL, REGEXP_PHONE, REGEXP_PWD } from '@/config';
|
||||
|
||||
/** 表单规则 */
|
||||
interface CustomFormRules {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { iconifyRender, customIconRender } from '../common';
|
||||
import { customIconRender, iconifyRender } from '../common';
|
||||
|
||||
/** 路由不转换菜单 */
|
||||
function hideInMenu(route: AuthRoute.Route) {
|
||||
@@ -74,7 +74,7 @@ function getActiveKeyPathsOfMenu(activeKey: string, menu: GlobalMenuOption) {
|
||||
keys.push(menu.routeName);
|
||||
}
|
||||
if (menu.children) {
|
||||
keys.push(...menu.children.map(item => getActiveKeyPathsOfMenu(activeKey, item)).flat(1));
|
||||
keys.push(...menu.children.map(item => getActiveKeyPathsOfMenu(activeKey, item as GlobalMenuOption)).flat(1));
|
||||
}
|
||||
return keys;
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@ import type { AxiosError, AxiosResponse } from 'axios';
|
||||
import {
|
||||
DEFAULT_REQUEST_ERROR_CODE,
|
||||
DEFAULT_REQUEST_ERROR_MSG,
|
||||
ERROR_STATUS,
|
||||
NETWORK_ERROR_CODE,
|
||||
NETWORK_ERROR_MSG,
|
||||
REQUEST_TIMEOUT_CODE,
|
||||
REQUEST_TIMEOUT_MSG,
|
||||
ERROR_STATUS
|
||||
REQUEST_TIMEOUT_MSG
|
||||
} from '@/config';
|
||||
import { exeStrategyActions } from '../common';
|
||||
import { showErrorMsg } from './msg';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { NO_ERROR_MSG_CODE, ERROR_MSG_DURATION } from '@/config';
|
||||
import { ERROR_MSG_DURATION, NO_ERROR_MSG_CODE } from '@/config';
|
||||
|
||||
/** 错误消息栈,防止同一错误同时出现 */
|
||||
const errorMsgStack = new Map<string | number, string>([]);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { encrypto, decrypto } from '../crypto';
|
||||
import { decrypto, encrypto } from '../crypto';
|
||||
|
||||
interface StorageData {
|
||||
value: unknown;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { encrypto, decrypto } from '../crypto';
|
||||
import { decrypto, encrypto } from '../crypto';
|
||||
|
||||
export function setSession(key: string, value: unknown) {
|
||||
const json = encrypto(value);
|
||||
|
||||
Reference in New Issue
Block a user