|
@@ -143,10 +143,10 @@
|
|
|
<el-upload class="avatar-upload"
|
|
|
ref="upload"
|
|
|
action="/api-web/uploadFile"
|
|
|
+ :headers="headers"
|
|
|
:on-preview="handlePreview"
|
|
|
:on-remove="handleRemove"
|
|
|
:on-change="handleChange"
|
|
|
- :before-upload="beforeImgUpload"
|
|
|
:file-list="fileList"
|
|
|
accept=".zip"
|
|
|
:multiple="false"
|
|
@@ -317,16 +317,6 @@ export default {
|
|
|
this.$refs["accountForm"].resetFields()
|
|
|
}
|
|
|
},
|
|
|
- beforeImgUpload (file) {
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 9;
|
|
|
- if (!isLt2M) {
|
|
|
- this.$message.error(`上传文件大小不能超过 ${9}MB!`);
|
|
|
- }
|
|
|
- if (isSize) {
|
|
|
- this.uploadImgLoading = true
|
|
|
- }
|
|
|
- return isSize;
|
|
|
- },
|
|
|
async onSubmit (formName) {
|
|
|
this.$refs[formName].validate(valid => {
|
|
|
if (valid) {
|
|
@@ -381,6 +371,13 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
handleChange (file) {
|
|
|
+ console.log(file)
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 9;
|
|
|
+ if (!isLt2M) {
|
|
|
+ this.$message.error(`上传文件大小不能超过 ${9}MB!`);
|
|
|
+ this.fileList = []
|
|
|
+ return
|
|
|
+ }
|
|
|
this.files = file
|
|
|
this.form.multipartFile = file.raw
|
|
|
this.$refs["accountForm"].validateField('multipartFile')
|