1
李凌
2025-10-09 e4ebf55acd52c163b63be076b8072b4eee3aac7e
src/utils/utis.js
@@ -264,4 +264,18 @@
export const handleImage = (url) => {
  return new URL(url, import.meta.url).href
}
}
// 字符串转数组
export const strToArr = (str, separator = ',') => {
    if (typeof str !== 'string') return [];
    return str.split(separator);
}
// 清除所有定时器
export const clearAllTimers = () => {
  let highestTimeoutId = setTimeout(() => {}, 0);
  for (let i = 0; i <= highestTimeoutId; i++) {
    clearTimeout(i);
    clearInterval(i);
  }
}