修改冀北现场反馈问题

This commit is contained in:
GGJ
2025-12-19 11:58:26 +08:00
parent d64d18f330
commit dc32cc3bb7
32 changed files with 865 additions and 426 deletions

View File

@@ -25,11 +25,17 @@ export const download = (urls: string) => {
})
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
let name=urls.split('/')[2].split('.')[0]
let name = removeLastDotSuffix(urls.split('/')[2])
link.href = url
link.download = name
document.body.appendChild(link)
link.click()
link.remove()
})
}
}
function removeLastDotSuffix(str: string) {
// 找到最后一个 . 的位置
const lastDotIndex = str.lastIndexOf('.')
// 如果存在 .,截取到 . 之前的部分;否则返回原字符串
return lastDotIndex !== -1 ? str.slice(0, lastDotIndex) : str
}