update:增加延时方法
This commit is contained in:
@@ -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);
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user