sandm пре 1 година
родитељ
комит
a6f64b79d4

+ 10 - 5
public/static/modular/gate/talentInfo/new_talentInfo_info.js

@@ -1370,11 +1370,16 @@ $(function () {
         var file = tag.files[0];
         var imgSrc;
         var reader = new FileReader();
-        reader.readAsDataURL(file);
-        reader.onload = function () {
-            imgSrc = this.result;
-            $("#photoImg").attr("src", imgSrc);
-        };
+        console.log(file)
+        if(toString.call(file) === '[object Blob]' || toString.call(file) === '[object File]'){
+            reader.readAsDataURL(file);
+            reader.onload = function () {
+                imgSrc = this.result;
+                $("#photoImg").attr("src", imgSrc);
+            };
+        }else{
+            alert('图片或浏览器不支持,请更换!!');
+        }
     });
     TalentInfoInfoDlg.setNoChangeField();
     $("#talent_condition").on('chosen:ready', function (e, params) {

+ 2 - 1
public/static/modular/gate/talentInfo/talentInfo_info.js

@@ -1113,7 +1113,8 @@ $(function () {
         var file = tag.files[0];
         var imgSrc;
         var reader = new FileReader();
-        if(toString.call(file) === '[object Blob]'){
+        console.log(file)
+        if(toString.call(file) === '[object Blob]' || toString.call(file) === '[object File]'){
             reader.readAsDataURL(file);
             reader.onload = function () {
                 imgSrc = this.result;