yearning
20 小时以前 1d37c375fd114212ee1419c3bbdadc81d76666a4
src/utils/tool.js
@@ -72,7 +72,7 @@
export const getOccupationName = (id) => {
  const { occupationItems } = useOptionItemsStore()
  const obj = occupationItems.find(ele => ele.id == id)
  return obj?.occupationJob || ''
}
@@ -108,7 +108,7 @@
  const { occupationItems } = useOptionItemsStore()
  const occupation = occupationItems.find(ele => ele.code == occupationCode)
  if (!occupation) return ''
  const job = occupation.jobs?.find(ele => ele.jobCode == jobCode)
  if (!job) return ''
@@ -131,7 +131,7 @@
  link.href = url.includes('http') ? url : $qxueyou.qxyRes + url ;
  link.download = filename || '文件';
  link.style.display = 'none';
  // 添加到文档并触发点击
  document.body.appendChild(link);
  link.click();
@@ -140,7 +140,7 @@
export const uploadByBase64 = async function(base64, fileName, fileType = 'png') {
  if (!base64) return null
  let blob = getBlobByBase64(base64, fileType)
  if (!blob) return null
@@ -177,7 +177,7 @@
      }
    }
    xhr.onerror = (evt) => { // 上传失败回调
      store.commit("snack/error", "上传失败!")
      // store.commit("snack/error", "上传失败!")
      console.log(JSON.stringify(evt.target))
      resolve(false)
    }
@@ -209,10 +209,10 @@
export const getFileUrlType = (url = '') => {
  if (!url) return false;
  const suffix = url.split('.').pop().toLowerCase()
  const suffix = url.split('.').pop().toLowerCase()
  const imageExtensions = [
    'jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp',
    'jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp',
    'svg', 'tiff', 'tif', 'ico', 'jfif', 'pjpeg', 'pjp',
    'apng', 'avif', 'heic', 'heif'
  ];