| | |
| | | }, |
| | | methods: { |
| | | beforeUpload(rawFile) { |
| | | console.log(rawFile); |
| | | if (rawFile.type !== 'image/png' && rawFile.type !== 'image/svg+xml' && rawFile.type !== 'image/jpg' && rawFile.type !== 'image/jpeg') { |
| | | this.$message.error('图片必须是 jpg/svg/jpeg/png 格式!') |
| | | return false |
| | | } else if (rawFile.size / 105 / 105 > 2) { |
| | | this.$message.error('上传图片不能超过 2MB!') |
| | | } else if (rawFile.size / 1024 / 1024 > 5) { |
| | | this.$message.error('上传图片不能超过 5MB!') |
| | | return false |
| | | } |
| | | return true |
| | | }, |
| | | handleSuccess(res, file, filelist) { |
| | | console.log(res); |
| | | this.$emit('getPicUrl', { obj: res.data, value: this.mykey }); |
| | | }, |
| | | getToken() { |