Browse Source

弹框图片上传存相对路径

njs 4 tháng trước cách đây
mục cha
commit
877b9c0a75

+ 3 - 3
suishenbang-admin/src/main/resources/templates/system/alertConfiguration/add.html

@@ -248,8 +248,8 @@
             contentType: false,
             success: function (result) {
                 if (result.code == 0) {
-                    photoUrl = result.data.url;
-                    $("#div-bgUrl").html("<img src='" + result.data.url + "' style='width:300px;margin-bottom: 5px;'>");
+                    photoUrl = result.data.fileName;
+                    $("#div-bgUrl").html("<img src='" + result.data.fileName + "' style='width:300px;margin-bottom: 5px;'>");
                 } else {
                     $.modal.alertWarning(result.msg);
                 }
@@ -370,4 +370,4 @@
     }
 </script>
 </body>
-</html>
+</html>

+ 6 - 6
suishenbang-admin/src/main/resources/templates/system/alertConfiguration/edit.html

@@ -36,7 +36,7 @@
                     <textarea id="alertContent" name="alertContent" class="form-control">[[*{alertContent}]]</textarea>
                 </div>
             </div>
-            <div class="form-group">    
+            <div class="form-group">
                 <label class="col-sm-3 control-label">弹框开始时间:</label>
                 <div class="col-sm-8">
                     <input id="alertStartTime" name="alertStartTime" th:value="${#dates.format(alertConfiguration.alertStartTime, 'yyyy-MM-dd HH:mm')}" class="form-control" type="datetime-local">
@@ -46,7 +46,7 @@
                     <!--</div>-->
                 </div>
             </div>
-            <div class="form-group">    
+            <div class="form-group">
                 <label class="col-sm-3 control-label">弹框结束时间:</label>
                 <div class="col-sm-8">
                     <input id="alertEndTime" name="alertEndTime" th:value="${#dates.format(alertConfiguration.alertEndTime, 'yyyy-MM-dd HH:mm')}" class="form-control" type="datetime-local">
@@ -56,7 +56,7 @@
                     <!--</div>-->
                 </div>
             </div>
-            <div class="form-group">    
+            <div class="form-group">
                 <label class="col-sm-3 control-label">弹框每日可弹次数:</label>
                 <div class="col-sm-8">
                     <input name="alertNum" th:field="*{alertNum}" class="form-control" type="number">
@@ -435,8 +435,8 @@
                 contentType: false,
                 success: function (result) {
                     if (result.code == 0) {
-                        photoUrl = result.data.url;
-                        $("#div-bgUrl").html("<img src='" + result.data.url + "' style='width:300px;margin-bottom: 5px;'>");
+                        photoUrl = result.data.fileName;
+                        $("#div-bgUrl").html("<img src='" + result.data.fileName + "' style='width:300px;margin-bottom: 5px;'>");
                     } else {
                         $.modal.alertWarning(result.msg);
                     }
@@ -500,4 +500,4 @@
         }
     </script>
 </body>
-</html>
+</html>