File tree Expand file tree Collapse file tree 3 files changed +3
-8
lines changed Expand file tree Collapse file tree 3 files changed +3
-8
lines changed Original file line number Diff line number Diff line change 33 "version" : " 0.1.0" ,
44 "private" : true ,
55 "scripts" : {
6- "serve" : " vue-cli-service serve" ,
6+ "serve" : " start https://www.gin-vue-admin.com && vue-cli-service serve" ,
77 "build" : " vue-cli-service build" ,
88 "lint" : " vue-cli-service lint"
99 },
Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ export default {
6161 }
6262 return isRightSize;
6363 },
64- handleImageSuccess (res , file ) {
64+ handleImageSuccess (res ) {
6565 // this.imageUrl = URL.createObjectURL(file.raw);
66- const { code , msg , data } = res;
66+ const { data } = res;
6767 if (data .file ) {
6868 this .$emit (" change" , data .file .url );
6969 }
Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ export default class ImageCompress {
3333
3434 if ( newImgSize > this . fileSize ) {
3535 console . log ( '图片尺寸太大!' + fileSize + " >> " + newImgSize )
36- reject ( `图片尺寸太大!` )
3736 }
3837
3938 let blob = this . dataURLtoBlob ( newImgData , fileType )
@@ -70,8 +69,6 @@ export default class ImageCompress {
7069 }
7170
7271 fileSizeKB ( dataURL ) {
73- let self = this
74-
7572 let sizeKB = 0
7673 sizeKB = Math . round ( ( dataURL . split ( ',' ) [ 1 ] . length * 3 / 4 ) / 1024 )
7774 return sizeKB
@@ -81,8 +78,6 @@ export default class ImageCompress {
8178 * 转为Blob
8279 * */
8380 dataURLtoBlob ( dataURL , fileType ) {
84- let self = this
85-
8681 let byteString = atob ( dataURL . split ( ',' ) [ 1 ] )
8782 let mimeString = dataURL . split ( ',' ) [ 0 ] . split ( ':' ) [ 1 ] . split ( ';' ) [ 0 ]
8883 let ab = new ArrayBuffer ( byteString . length )
You can’t perform that action at this time.
0 commit comments