Commit 50f0d4c7 authored by 何远江's avatar 何远江

1

parent b504e336
...@@ -34,7 +34,9 @@ const generateExcel = async (path: string) => { ...@@ -34,7 +34,9 @@ const generateExcel = async (path: string) => {
// 保存浏览文件的地址 // 保存浏览文件的地址
filePath.value = path filePath.value = path
try { try {
const res = await axios.get('/api/sys/static/' + path) // 验证文件是否存在
await axios.get('/api/sys/static/' + path)
LuckyExcel.transformExcelToLuckyByUrl( LuckyExcel.transformExcelToLuckyByUrl(
'/api/sys/static/' + path, '/api/sys/static/' + path,
new Date().getTime() + '.xlsx', new Date().getTime() + '.xlsx',
...@@ -55,7 +57,7 @@ const generateExcel = async (path: string) => { ...@@ -55,7 +57,7 @@ const generateExcel = async (path: string) => {
} }
) )
} catch (e) { } catch (e) {
console.log(e, 'eeee') // 验证文件是否存在,不存在报错
if (e?.response) { if (e?.response) {
ElMessage.error(e.response.data.message) ElMessage.error(e.response.data.message)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment