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
zhangtianqi
about a year ago
Commit
7843beb715d20817996dfecf194c306d2ba36a0a
1 parent
15dfdc57
禅道:漏洞上传文件
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
2 deletions
hg-monitor-web-base/src/main/resources/static/src/controller/main-biz-card.js
hg-monitor-web-qh/src/main/resources/static/vue3/src/views/documentationManagement/vulnerability.html
hg-monitor-web-qh/src/main/resources/static/vue3/src/views/documentationManagement/vulnerability.js
hg-monitor-web-base/src/main/resources/static/src/controller/main-biz-card.js
View file @
7843beb
...
...
@@ -128,6 +128,9 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions
<
/div
>
<
div
><
input
type
=
"hidden"
id
=
"vulnerabilitiesId"
name
=
"vulnerabilitiesId"
value
=
"${d.id}"
><
/div
>
<
/div
>
<
div
class
=
"layui-form-item"
>
<
button
type
=
"button"
class
=
"download"
>
下载附件
<
/button
>
<
/div
>
<
/form
>
`
//漏洞处理抽屉
...
...
@@ -143,6 +146,50 @@ layui.define(['common', 'swiper', 'admin', 'commonDetail', 'mxClient', 'sessions
move
:
false
,
success
:()
=>
{
form
.
render
();
if
(
d
.
filePath
){
let
docMime
=
d
.
fileName
.
slice
(
d
.
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
([
d
.
filePath
],
{
type
:
mineType
}));
console
.
log
(
url
);
let
link
=
document
.
createElement
(
"a"
);
link
.
style
.
display
=
"none"
;
link
.
href
=
url
;
link
.
setAttribute
(
"download"
,
d
.
fileName
);
document
.
body
.
appendChild
(
link
);
link
.
click
();
// 销毁超连接
window
.
URL
.
revokeObjectURL
(
url
);
}
else
{
layer
.
msg
(
"无附件信息"
,
{
offset
:
'15px'
,
icon
:
7
,
time
:
1000
});
}
},
yes
:(
index
)
=>
{
var
formData
=
form
.
val
(
'vulnerabilityForm'
);
...
...
hg-monitor-web-qh/src/main/resources/static/vue3/src/views/documentationManagement/vulnerability.html
View file @
7843beb
...
...
@@ -118,7 +118,6 @@
ref=
"upload"
action=
"#"
style=
"display: inline"
:auto-upload=
"false"
:limit=
"1"
:on-exceed=
"handleExceed"
:auto-upload=
"false"
...
...
hg-monitor-web-qh/src/main/resources/static/vue3/src/views/documentationManagement/vulnerability.js
View file @
7843beb
...
...
@@ -263,7 +263,7 @@ export default {
default
:
break
;
}
let
url
=
window
.
URL
.
createObjectURL
(
new
Blob
([
row
.
filePath
],
{
type
:
"application/msword"
}));
let
url
=
window
.
URL
.
createObjectURL
(
new
Blob
([
row
.
filePath
],
{
type
:
mineType
}));
let
link
=
document
.
createElement
(
"a"
);
link
.
style
.
display
=
"none"
;
link
.
href
=
url
;
...
...
Please
register
or
login
to post a comment