Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
郑艺斌
/
emaint-web-master
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6a53136d
authored
Dec 05, 2022
by
郑艺斌
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复上传BUG
parent
f37cbcdb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletions
src/views/problemConfiguration/index.vue
src/views/problemConfiguration/index.vue
View file @
6a53136d
...
...
@@ -270,7 +270,8 @@ export default {
orgId
:
""
,
projectId
:
""
,
},
projectList
:
[]
projectList
:
[],
imgTypeArr
:
[
"image/png"
,
"image/jpg"
,
"image/jpeg"
],
//上传图片类型限制
};
},
computed
:
{
...
...
@@ -317,11 +318,30 @@ export default {
},
async
handleBeforeUpload
(
res
)
{
// return this.checkImageWH(res, 64, 64)
let
that
=
this
// 控制文件上传格式
var
imgType
=
this
.
imgTypeArr
.
indexOf
(
res
.
type
)
!==
-
1
if
(
!
imgType
)
{
this
.
$Message
.
warning
({
content
:
'文件 '
+
res
.
name
+
' 格式不正确, 请选择jpg或png.'
,
duration
:
5
});
return
false
}
},
handleSuccess
(
res
,
file
)
{
console
.
log
(
res
,
'999'
);
if
(
res
.
statusCode
==
200
)
{
this
.
seriesImage
=
res
.
responseResult
file
.
url
=
res
.
responseResult
this
.
uploadList
.
push
(
file
)
}
else
{
this
.
$Message
.
warning
({
content
:
'图片格式异常,仅支持jpg、png图片上传!'
,
duration
:
5
});
}
},
checkImageWH
(
file
,
width
,
height
)
{
let
self
=
this
;
...
...
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