Commit cfd94268 authored by 盖献康's avatar 盖献康

公用文件下载方法 - bug

parent c2b119eb
...@@ -194,11 +194,15 @@ export default { ...@@ -194,11 +194,15 @@ export default {
}, },
// 获取展示文件名称 // 获取展示文件名称
getShowFileName(name) { getShowFileName(name) {
if (name.lastIndexOf('-') > -1) { const keyword = '-'
return name.substring(name.lastIndexOf('-') + 1) const index = name.indexOf(keyword, name.indexOf(keyword) + 1)
let result = ''
if (index !== -1) {
result = name.substring(index + keyword.length)
} else { } else {
return '' result = 'aa.pdf'
} }
return result
}, },
// 对象转成指定字符串分隔 // 对象转成指定字符串分隔
listToString(list, separator) { listToString(list, separator) {
......
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
if (index !== -1) { if (index !== -1) {
result = url.substring(index + keyword.length) result = url.substring(index + keyword.length)
} else { } else {
return 'aa.pdf' result = 'aa.pdf'
} }
this.saveAs(blob, result) this.saveAs(blob, result)
} else { } else {
......
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