Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pet-business-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘怀志
pet-business-web
Commits
cfd94268
Commit
cfd94268
authored
Aug 23, 2023
by
盖献康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
公用文件下载方法 - bug
parent
c2b119eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
index.vue
src/components/FileUpload/index.vue
+7
-3
download.js
src/plugins/download.js
+1
-1
No files found.
src/components/FileUpload/index.vue
View file @
cfd94268
...
...
@@ -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
{
re
turn
'
'
re
sult
=
'aa.pdf
'
}
return
result
},
// 对象转成指定字符串分隔
listToString
(
list
,
separator
)
{
...
...
src/plugins/download.js
View file @
cfd94268
...
...
@@ -43,7 +43,7 @@ export default {
if
(
index
!==
-
1
)
{
result
=
url
.
substring
(
index
+
keyword
.
length
)
}
else
{
re
turn
'aa.pdf'
re
sult
=
'aa.pdf'
}
this
.
saveAs
(
blob
,
result
)
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment