From 16402e79c1081f608f57596fce77403a56130e35 Mon Sep 17 00:00:00 2001 From: QM303176530 <303176530@qq.com> Date: Sun, 11 Oct 2020 11:42:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dwarning=20=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E8=87=AA=E5=8A=A8=E6=89=93=E5=BC=80=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/package.json | 2 +- web/src/components/upload/image.vue | 4 ++-- web/src/utils/image.js | 5 ----- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/web/package.json b/web/package.json index 2120187b..e5c49d7c 100644 --- a/web/package.json +++ b/web/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "serve": "vue-cli-service serve", + "serve": "start https://www.gin-vue-admin.com && vue-cli-service serve", "build": "vue-cli-service build", "lint": "vue-cli-service lint" }, diff --git a/web/src/components/upload/image.vue b/web/src/components/upload/image.vue index 8f854f97..c5c9d92e 100644 --- a/web/src/components/upload/image.vue +++ b/web/src/components/upload/image.vue @@ -61,9 +61,9 @@ export default { } return isRightSize; }, - handleImageSuccess(res, file) { + handleImageSuccess(res) { // this.imageUrl = URL.createObjectURL(file.raw); - const { code, msg, data } = res; + const { data } = res; if (data.file) { this.$emit("change", data.file.url); } diff --git a/web/src/utils/image.js b/web/src/utils/image.js index d54088c6..48154a85 100644 --- a/web/src/utils/image.js +++ b/web/src/utils/image.js @@ -33,7 +33,6 @@ export default class ImageCompress { if (newImgSize > this.fileSize) { console.log('图片尺寸太大!' + fileSize + " >> " + newImgSize) - reject(`图片尺寸太大!`) } let blob = this.dataURLtoBlob(newImgData, fileType) @@ -70,8 +69,6 @@ export default class ImageCompress { } fileSizeKB(dataURL) { - let self = this - let sizeKB = 0 sizeKB = Math.round((dataURL.split(',')[1].length * 3 / 4) / 1024) return sizeKB @@ -81,8 +78,6 @@ export default class ImageCompress { * 转为Blob * */ dataURLtoBlob(dataURL, fileType) { - let self = this - let byteString = atob(dataURL.split(',')[1]) let mimeString = dataURL.split(',')[0].split(':')[1].split(';')[0] let ab = new ArrayBuffer(byteString.length)