rabin 5 years ago
parent
commit
9270d8de01
1 changed files with 24 additions and 0 deletions
  1. 24 0
      assets/lib/layui/upload.js

+ 24 - 0
assets/lib/layui/upload.js

@@ -307,6 +307,18 @@ function loadUploadL(i,e,key,url,assets)
 					layer.closeAll('loading');
 					var data = {};
 			      if (res.hash) {
+
+			      	if (search.indexOf('#') != -1) {
+						var temp = search.split('#');
+						search = temp[0];
+						if (temp[1]) {
+							temp[1] = $('#update_'+temp[1]+'_value').val();
+							if (temp[1] > 0) {
+								search = search + '_' + temp[1];
+							}
+						}
+					}
+
 			      	$.getJSON(uploadUrl.replace('save.start', 'qiniu.addFile'), {source:file.name,file:res.key, key:key, search:search});
 						data.status = 1;
 						data.name = res.key;
@@ -408,6 +420,18 @@ function loadUpload(i,e,key,url,assets)
 				$('#' + id + '_progress').show();
 			    element.progress(id + '_progress', value+'%')//设置页面进度条
 			}
+			,before: function(obj){
+				if (this.data.search.indexOf('#') != -1) {
+					var temp = this.data.search.split('#');
+					this.data.search = temp[0];
+					if (temp[1]) {
+						temp[1] = $('#update_'+temp[1]+'_value').val();
+						if (temp[1] > 0) {
+							this.data.search = this.data.search + '_' + temp[1];
+						}
+					}
+				}
+            }
 			,choose: function(obj, self){
 				if (domain) {
 					obj.editFile(path, cover);