소스 검색

2020-01-15 年前修改

hugeng 4 년 전
부모
커밋
a28acb72d1

+ 1 - 1
src/main/java/com/yc/education/controller/BaseController.java

@@ -260,7 +260,7 @@ public class BaseController {
                     }
                 }
             } else {
-                pathString = "";
+                pathString = "error";
             }
         }
         // pathString="cao";

+ 28 - 25
src/main/webapp/WEB-INF/jsp/index.jsp

@@ -122,9 +122,9 @@ To change this template use File | Settings | File Templates.
                         </div>
                     </div>
                     <form id="forum" method="post" action="forumadd">
-						
+
                         <div id="content-publish" class="content-publish" style="display: none; position:relative;">
-							<a class="closebtn">关闭</a>
+                            <a class="closebtn">关闭</a>
                             <div class="title-area">
                                 <span>能分享的不只是图纸,试一试?</span><span class="text">个字</span><span class="num">0</span><span
                                     class="text">已输入</span>
@@ -1213,25 +1213,26 @@ To change this template use File | Settings | File Templates.
 
         function customdetfilechen() {
             $("#file").change(function () {
-                $.ajaxFileUpload({
-                    fileElementId: 'file',
-                    url: 'uploadImages',
-                    dataType: 'text',
-                    data: {},
-                    async: true,
-                    error: function (data) {
-                        alert("网络异常,请重试");
-                    },
-                    success: function (message) {
-                        if (message != null) {
-                            $("#fileup").text("上传成功");
-                            console.log(message);
-                            $("#fileurl").val(message);
+                    $.ajaxFileUpload({
+                        fileElementId: 'file',
+                        url: 'uploadImages',
+                        dataType: 'text',
+                        data: {},
+                        async: true,
+                        error: function (data) {
+                            alert("网络异常,请重试");
+                        },
+                        success: function (message) {
+                            if (message != null) {
+                                $("#fileup").text("上传成功");
+                                console.log(message);
+                                $("#fileurl").val(message);
+                            }
+                            customdetfilechen();
                         }
-                        customdetfilechen();
-                    }
-                });
-            });
+                    });
+                }
+            );
         }
 
         $("#imgsfile").change(function () {
@@ -1245,11 +1246,12 @@ To change this template use File | Settings | File Templates.
                     alert("网络异常,请重试");
                 },
                 success: function (message) {
-                    if (message != null) {
+                    if (message != null && message != 'error') {
                         $("#hint").text("上传成功");
                         $("#imgurl").val(message);
                     } else {
                         $("#hint").text("上传失败");
+                        layer.msg("可以上传不超过9张的图片");
                     }
                     imgsfile();
                 }
@@ -1268,12 +1270,13 @@ To change this template use File | Settings | File Templates.
                         alert("网络异常,请重试");
                     },
                     success: function (message) {
-                        if (message != null) {
+                        if (message != null && message != 'error') {
                             $("#hint").text("上传成功");
                             console.log(message);
                             $("#imgurl").val(message);
                         } else {
                             $("#hint").text("上传失败");
+                            layer.msg("可以上传不超过9张的图片");
                         }
                         imgsfile();
                     }
@@ -1288,10 +1291,10 @@ To change this template use File | Settings | File Templates.
             $("#content-publish").show();
             $(this).hide();
         });
-		
-		$(".closebtn").click(function () {
+
+        $(".closebtn").click(function () {
             $("#content-publish").hide();
-			$(".fb_enter").show();
+            $(".fb_enter").show();
         });
 
         $(".limits").click(function () {

+ 19 - 17
src/main/webapp/WEB-INF/jsp/person.jsp

@@ -1167,7 +1167,7 @@ To change this template use File | Settings | File Templates.
                             htmls = "<div class='pic_list'><a class='delsimg' id=" + imss + ">删除</a> <img src=" + obj.imgurl + " id='imgs'  width='50px'></div>";
                         }
                         $("#hint").html(htmls);
-                    }else {
+                    } else {
                         $("#hint").text("可以上传不超过9张的图片");
                     }
                     var html = '';
@@ -1298,13 +1298,13 @@ To change this template use File | Settings | File Templates.
                         alert("网络异常,请重试");
                     },
                     success: function (message) {
-                        if (message != null) {
+                        if (message != null && message != 'error') {
                             var html = $("#imgurl").val();
                             var htmls = '';
                             if (html != '') {
                                 $("#imgurl").val(html + "," + message);
                                 if (message.indexOf(",") != -1) {
-                                    var ims = obj.message.split(",");
+                                    var ims = message.split(",");
                                     for (var i = 0; i < ims.length; i++) {
                                         var imss = ims[i];
                                         htmls = "<div class='pic_list'><a class='delsimg' id=" + imss + ">删除</a> <img src=" + imss + " id='imgs' width='50px'></div>" + htmls;
@@ -1315,18 +1315,19 @@ To change this template use File | Settings | File Templates.
                                 $("#hint").append(htmls);
                             } else {
                                 if (message.indexOf(",") != -1) {
-                                    var ims = obj.message.split(",");
+                                    var ims = message.split(",");
                                     for (var i = 0; i < ims.length; i++) {
                                         var imss = ims[i];
-                                        htmls = "<div><a class='delsimg' id=" + imss + ">删除</a> <img src=" + imss + " id='imgs' width='50px'></div>" + htmls;
+                                        htmls = "<div class='pic_list'><a class='delsimg' id=" + imss + ">删除</a> <img src=" + imss + " id='imgs' width='50px'></div>" + htmls;
                                     }
                                 } else {
-                                    htmls = "<div><a class='delsimg' id=" + message + ">删除</a> <img src=" + message + " id='imgs'  width='50px'></div>"
+                                    htmls = "<div class='pic_list'><a class='delsimg' id=" + message + ">删除</a> <img src=" + message + " id='imgs'  width='50px'></div>"
                                 }
-                                $("#imgurl").text(htmls);
+                                $("#hint").text(htmls);
                             }
                         } else {
                             $("#hint").text("上传失败");
+                            layer.msg("可以上传不超过9张的图片");
                         }
                         imgsfile();
                     }
@@ -1345,35 +1346,36 @@ To change this template use File | Settings | File Templates.
                             alert("网络异常,请重试");
                         },
                         success: function (message) {
-                            if (message != null) {
-                                // $("#hint").text("上传成功");
-                                // console.log(message);
+                            if (message != null && message != 'error') {
+                                var html = $("#imgurl").val();
+                                var htmls = '';
                                 if (html != '') {
                                     $("#imgurl").val(html + "," + message);
                                     if (message.indexOf(",") != -1) {
-                                        var ims = obj.message.split(",");
+                                        var ims = message.split(",");
                                         for (var i = 0; i < ims.length; i++) {
                                             var imss = ims[i];
-                                            htmls = "<div><a class='delsimg' id=" + imss + ">删除</a> <img src=" + imss + " id='imgs' width='50px'></div>" + htmls;
+                                            htmls = "<div class='pic_list'><a class='delsimg' id=" + imss + ">删除</a> <img src=" + imss + " id='imgs' width='50px'></div>" + htmls;
                                         }
                                     } else {
-                                        htmls = "<div><a class='delsimg' id=" + message + ">删除</a> <img src=" + message + " id='imgs'  width='50px'></div>"
+                                        htmls = "<div class='pic_list'><a class='delsimg' id=" + message + ">删除</a> <img src=" + message + " id='imgs'  width='50px'></div>"
                                     }
                                     $("#hint").append(htmls);
                                 } else {
                                     if (message.indexOf(",") != -1) {
-                                        var ims = obj.message.split(",");
+                                        var ims = message.split(",");
                                         for (var i = 0; i < ims.length; i++) {
                                             var imss = ims[i];
-                                            htmls = "<div><a class='delsimg' id=" + imss + ">删除</a> <img src=" + imss + " id='imgs' width='50px'></div>" + htmls;
+                                            htmls = "<div class='pic_list'><a class='delsimg' id=" + imss + ">删除</a> <img src=" + imss + " id='imgs' width='50px'></div>" + htmls;
                                         }
                                     } else {
-                                        htmls = "<div><a class='delsimg' id=" + message + ">删除</a> <img src=" + message + " id='imgs'  width='50px'></div>"
+                                        htmls = "<div class='pic_list'><a class='delsimg' id=" + message + ">删除</a> <img src=" + message + " id='imgs'  width='50px'></div>"
                                     }
-                                    $("#imgurl").text(htmls);
+                                    $("#hint").text(htmls);
                                 }
                             } else {
                                 $("#hint").text("上传失败");
+                                layer.msg("可以上传不超过9张的图片");
                             }
                             imgsfile();
                         }

+ 13 - 9
src/main/webapp/WEB-INF/jsp/sechindex.jsp

@@ -99,7 +99,7 @@ To change this template use File | Settings | File Templates.
                 <div class="index-center">
                     <form id="forum" method="post" action="forumadd">
                         <div id="content-publish" class="content-publish" style="display: none;">
-							<a class="closebtn">关闭</a>
+                            <a class="closebtn">关闭</a>
                             <div class="title-area">
                                 <span>能分享的不只是图纸,试一试?</span><span class="text">个字</span><span class="num">0</span><span
                                     class="text">已输入</span>
@@ -994,10 +994,12 @@ To change this template use File | Settings | File Templates.
                     alert("网络异常,请重试");
                 },
                 success: function (message) {
-                    if (message != null) {
+                    if (message != null && message != 'error') {
                         $("#fileup").text("上传成功");
-                        console.log(message);
                         $("#imgurl").val(message);
+                    } else {
+                        $("#fileup").text("上传失败");
+                        layer.msg("可以上传不超过9张的图片");
                     }
                     imgsfile();
                 }
@@ -1016,10 +1018,12 @@ To change this template use File | Settings | File Templates.
                         alert("网络异常,请重试");
                     },
                     success: function (message) {
-                        if (message != null) {
+                        if (message != null && message != 'error') {
                             $("#fileup").text("上传成功");
-                            console.log(message);
                             $("#imgurl").val(message);
+                        } else {
+                            $("#fileup").text("上传失败");
+                            layer.msg("可以上传不超过9张的图片");
                         }
                         imgsfile();
                     }
@@ -1035,12 +1039,12 @@ To change this template use File | Settings | File Templates.
             $("#content-publish").show();
             $(this).hide();
         });
-		
-		$(".closebtn").click(function () {
+
+        $(".closebtn").click(function () {
             $("#content-publish").hide();
-			$(".fb_enter").show();
+            $(".fb_enter").show();
         });
-		
+
         $(".limits").click(function () {
             if ($(this).children(".pub-sel").hasClass("open")) {
                 $(this).children(".pub-sel").removeClass("open")