Toggle navigation
Toggle navigation
This project
Loading...
Sign in
monitor_v3
/
hg-monitor-web
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
wf
about a year ago
Commit
9e4bd02d8bc190aaa51fefd88a6ff9af884a70a4
1 parent
894f3aee
附件下载
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
5 deletions
hg-monitor-web-qh/src/main/resources/static/vue3/src/views/documentationManagement/vulnerability.js
hg-monitor-web-qh/src/main/resources/static/vue3/src/views/documentationManagement/vulnerability.js
View file @
9e4bd02
...
...
@@ -233,11 +233,51 @@ export default {
// 下载文件
const
handleDownload
=
(
row
)
=>
{
if
(
row
.
filePath
){
proxy
.
$http
.
get
(
'/api-web/vulnerabilities/download'
,{
path
:
row
.
filePath
,
name
:
row
.
fileName
},
function
(
res
)
{
handleForm
.
value
.
manufacturerName
=
res
.
str
;
})
let
docMime
=
row
.
fileName
.
slice
(
row
.
fileName
.
lastIndexOf
(
'.'
)
+
1
);
// 获取文件的后缀
console
.
log
(
docMime
,
"-------"
);
// 判断下载的文件类型
let
mineType
=
""
;
switch
(
docMime
)
{
case
"xls"
:
mineType
=
"application/vnd.ms-excel"
;
break
;
case
"xlsx"
:
mineType
=
"application/vnd.ms-excel"
;
break
;
case
"docx"
:
mineType
=
"application/msword"
;
break
;
case
"doc"
:
mineType
=
"application/msword"
;
break
;
case
"zip"
:
mineType
=
"application/zip"
;
break
;
case
"html"
:
mineType
=
"text/html"
;
break
;
case
"markdown"
:
mineType
=
"text/markdown"
;
break
;
default
:
break
;
}
let
url
=
window
.
URL
.
createObjectURL
(
new
Blob
([
row
.
filePath
],
{
type
:
"application/msword"
}));
let
link
=
document
.
createElement
(
"a"
);
link
.
style
.
display
=
"none"
;
link
.
href
=
url
;
link
.
setAttribute
(
"download"
,
row
.
fileName
);
document
.
body
.
appendChild
(
link
);
link
.
click
();
// 销毁超连接
window
.
URL
.
revokeObjectURL
(
url
);
// proxy.$http.get('/api-web/vulnerabilities/download',{
// path: row.filePath,name:row.fileName
// }, function (res) {
// handleForm.value.manufacturerName = res.str;
// })
}
else
{
proxy
.
$global
.
showMsg
(
"无附件信息"
,
'warning'
);
}
...
...
Please
register
or
login
to post a comment