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

公用文件下载方法 - bug

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