ソースを参照

文章编辑图片url判断

yangc 7 年 前
コミット
01e90b7468

+ 7 - 3
src/main/webapp/resources/js/admin/controllers/help/HelpDetailCtrl.js

@@ -76,8 +76,10 @@ define(['app/app'], function(app) {
             var imgs = els.find('img');
             var promises = [];
             angular.forEach(imgs, function (img) {
-                promises.push(switchBase64ToImg(img).$promise);
-            })
+                if (img.src && img.src.indexOf('http://') < 0) {
+                    promises.push(switchBase64ToImg(img).$promise);
+                }
+            });
             $q.all(promises).then(function () {
                 // console.log(els.html());
                 $scope.issue.article = els.html()
@@ -99,7 +101,9 @@ define(['app/app'], function(app) {
             var imgs = els.find('img');
             var promises = [];
             angular.forEach(imgs, function (img) {
-                promises.push(switchBase64ToImg(img).$promise);
+                if (img.src && img.src.indexOf('http://') < 0) {
+                    promises.push(switchBase64ToImg(img).$promise);
+                }
             })
             $q.all(promises).then(function () {
                 // console.log(els.html());

+ 3 - 1
src/main/webapp/resources/js/admin/controllers/help/HelpEditCtrl.js

@@ -59,7 +59,9 @@ define(['app/app'], function(app) {
             var imgs = els.find('img');
             var promises = [];
             angular.forEach(imgs, function (img) {
-                promises.push(switchBase64ToImg(img).$promise);
+                if (img.src && img.src.indexOf('http://') < 0) {
+                    promises.push(switchBase64ToImg(img).$promise);
+                }
             })
             $q.all(promises).then(function () {
                 // console.log(els.html());