ccjgmwz преди 3 години
родител
ревизия
d8e16d3b10
променени са 3 файла, в които са добавени 9 реда и са изтрити 5 реда
  1. 1 1
      components/ossutil/crypto.js
  2. 1 1
      components/upload.vue
  3. 7 3
      pageD/identity/companyIdentity.vue

+ 1 - 1
components/ossutil/crypto.js

@@ -103,7 +103,7 @@ var util = Crypto.util = {
 	bytesToBase64: function (bytes) {
 
 		// Use browser-native function if it exists
-		if (typeof btoa == "function") return btoa(util.bytesToString(bytes));
+		// if (typeof btoa == "function") return btoa(util.bytesToString(bytes));
 
 		var base64 = [],
 		    overflow;

+ 1 - 1
components/upload.vue

@@ -355,7 +355,7 @@
 						if (this.autoUpload) this.uploadFile(listOldLength);
 					})
 					.catch(error => {
-						// this.$emit('on-error', error);
+						this.$emit('on-error', error);
 					});
 			},
 			// 提示用户消息

+ 7 - 3
pageD/identity/companyIdentity.vue

@@ -14,6 +14,7 @@
 					:max-count="1"
 					:size-type="['compressed']"
 					@on-success="getImgUrl"
+					@on-error="onError"
 					@on-remove="onRemove"
 					@on-uploaded="isAdd = true"
 					:before-upload="filterFileType"
@@ -87,15 +88,15 @@
 		data() {
 			return {
 				action: this.$uploadUrl,
-				maxSize: 2 * 1024 * 1024, //限制文件大小 2M
+				maxSize: 5 * 1024 * 1024, //限制文件大小 2M
 				btnLoading: false, //防止重复点击
 				isAdd: true,
 				imgUrls:[],
 				uploadCustom:true,
 				uploadOptions:{
 					"text":"上传营业执照",
-					"imgSrc":"../../static/img/authentication/xiangji@3x.png",
-					"bgc":"../../static/img/authentication/business@3x.png"
+					"imgSrc":"~@/static/img/authentication/xiangji@3x.png",
+					"bgc":"~@/static/img/authentication/business@3x.png"
 				},
 				tupian: "",
 				inputContent: null,
@@ -143,6 +144,9 @@
 				console.log(res)
 				this.imgUrls.push(res);
 			},
+			onError(error){
+				console.log(error)
+			},
 			onRemove(index) {
 				this.imgUrls.splice(index, 1);
 			},