dever 6 anos atrás
pai
commit
b99512d7ab

+ 27 - 7
assets/lib/kindeditor/kindeditor-all-min.js

@@ -6015,7 +6015,12 @@ function dopasteImg() {
             formData.append(self.filePostName, myBlob, "untitled." + t.split('/')[1]);  
             //formData.append('imgFile', b);  
             formData.append('dir', isImg ? 'image' : 'file');  
-            xhr.open('POST', self.uploadJson);  
+            if (self.uploadYunJson && self.uploadYunJson.domain) {
+            	xhr.open('POST', self.uploadJson.domain);  
+            } else {
+            	xhr.open('POST', self.uploadJson);  
+            }
+            
             xhr.onreadystatechange = function () {  
                 if (xhr.readyState == 4&&xhr.status == 200) {  
                     // if (fn) {  
@@ -10112,15 +10117,30 @@ function autoImg(self) {
     $(img).each(function (i) {
         var that = $(this);
         var host = gethost(self.uploadJson);
+        if (self.uploadYunJson && self.uploadYunJson.host) {
+        	var yhost = gethost(self.uploadYunJson.host);
+        }
+        
         if (that.attr("src").indexOf("http://") >= 0 || that.attr("src").indexOf("https://") >= 0) {
         	var n = gethost(that.attr("src"));
-        	if (host != n) {
-        		piccount++;
-	            if (i == $(img).length - 1)
-	                sstr += that.attr("src");
-	            else
-	                sstr += that.attr("src") + ",";
+        	if (yhost) {
+        		if (host != n && yhost != n) {
+	        		piccount++;
+		            if (i == $(img).length - 1)
+		                sstr += that.attr("src");
+		            else
+		                sstr += that.attr("src") + ",";
+	        	}
+        	} else {
+        		if (host != n) {
+	        		piccount++;
+		            if (i == $(img).length - 1)
+		                sstr += that.attr("src");
+		            else
+		                sstr += that.attr("src") + ",";
+	        	}
         	}
+        	
         }
     });
 

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

@@ -196,6 +196,7 @@ function loadUploadL(i,e,key,url,assets)
 		      // 设置next,error,complete对应的操作,分别处理相应的进度信息,错误信息,以及完成后的操作
 		      var error = function(err) {
 		        //请求异常回调
+		        console.log(err);
 				layer.alert('文件上传错误');
 				element.progress(id + '_progress', '0%')
 				$('#' + id + '_progress').hide();

+ 14 - 0
assets/lib/manage/main.js

@@ -323,6 +323,19 @@ function loadEditorParam(e)
 	}
 	var key = e.attr('key');
 	var media = e.attr('media');
+
+	var token = e.attr('token');
+	var host = e.attr('host');
+	var domain = e.attr('domain');
+	var path = e.attr('path');
+
+	var yun = {};
+	if (token && host) {
+		yun.token = token;
+		yun.host = host;
+		yun.domain = domain;
+		yun.path = path;
+	}
 	if (!media) {
 		media = key;
 	}
@@ -339,6 +352,7 @@ function loadEditorParam(e)
 		dialogOffset : 0, //对话框距离页面顶部的位置,默认为0居中,
 		uploadJson : config.upload + '.kindeditor?key=' + key,
 		uploadMediaJson : config.upload + '.kindeditor?key=' + media,
+		uploadYunJson : yun,
 		fileManagerJson : view + '.files?key=' + media,
 
 		items : [