1
李凌
2025-10-11 4931fb42270d5fd00a0a22270d684476ffa53917
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);
  }
}