update:增加延时方法

This commit is contained in:
2025-11-13 20:48:01 +08:00
parent f773f7284b
commit 1c1413acf3

View File

@@ -1,7 +1,7 @@
import { getAllDictionaryDataApi } from '@/api/system/systemData';
import { CommonStore } from '@/stores/common';
export const getAllDictDataFun = async(refresh?: boolean) => {
export const getAllDictDataFun = async (refresh?: boolean) => {
const storageDictData = localStorage.getItem('TOTAL_DICTIONARY_DATA');
if (storageDictData && !refresh) {
CommonStore().setAllDictData(JSON.parse(storageDictData));
@@ -63,3 +63,15 @@ export const objectTypeArrayRemovesDuplicates = (arr: any[], type: number) => {
});
}
};
/**
*
* @param delayTime 延迟的时间
*/
export const delayTime = async (delayTime: number) => {
await new Promise((resolve, reject) => {
setTimeout(() => {
resolve('');
}, delayTime);
});
};