Commit e4e0aeae by 黄森林

bug修改

parent cb8b8e8e
......@@ -144,16 +144,6 @@
},
methods:{
transformFile(file) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
if (!isJpgOrPng) {
this.$message.error('You can only upload JPG file!');
return isJpgOrPng && isLt2M;
}
const isLt2M = file.size / 1024 / 1024 < 5;
if (!isLt2M) {
this.$message.error('文件不能超过5MB!');
return isJpgOrPng && isLt2M;
}
return new Promise(resolve => {
const reader = new FileReader();
reader.readAsDataURL(file);
......@@ -172,6 +162,7 @@
ctx.fillRect(0,0,canvas.width,canvas.height)
ctx.drawImage(img,0,0,width,height)
const picture = canvas.toDataURL('image/jpeg')
console.log(picture)
return uploadPicture({picture}).then(res => {
if(res.state == 'error'){
this.$message.error(res.msg,5);
......
......@@ -86,7 +86,7 @@
<a-dropdown>
<a-menu slot="overlay" @click="handleMenuClick">
<a-menu-item key="1">
<a-icon type="arrow-up" />批量处理
<a-icon type="arrow-up" />受理单
</a-menu-item>
<a-menu-item key="2">
<a-icon type="arrow-up" />快递
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment