瀏覽代碼

2025-01-02 download error update

junggilpark 7 月之前
父節點
當前提交
16be276747

二進制
src/main/resources/static/images/icon/intersection2.png


+ 0 - 1
src/main/resources/static/js/common/common.js

@@ -14,7 +14,6 @@ function getDataAsync(url, method, param, args, successFunc, errorFunc ) {
                 errorFunc(request, status, error);
             }
             else {
-                console.log(error.responseJSON);
                 if (error.responseJSON) {
                     // 400: Bad Request
                     // 404: Not Found

+ 0 - 1
src/main/resources/static/js/naverEditor/sample/photo_uploader/attach_photo.js

@@ -576,7 +576,6 @@
 	 * ]
 	 */
  	function setPhotoToEditor(oFileInfo){
-		 console.log(oFileInfo);
 		if (!!opener && !!opener.nhn && !!opener.nhn.husky && !!opener.nhn.husky.PopUpManager) {
 			//스마트 에디터 플러그인을 통해서 넣는 방법 (oFileInfo는 Array)
 			opener.nhn.husky.PopUpManager.setCallback(window, 'SET_PHOTO', [oFileInfo]);

+ 0 - 2
src/main/resources/static/js/traffic/traffic_new.js

@@ -334,9 +334,7 @@ function moveLocation(xCoordinate, yCoordinate, listIndex) {
 function getCctv() {
     getDataAsync('/api/traffic/cctv-list', 'POST', null, null, (cctvData)=>{
         getDataAsync('/api/itcs/detail-list', 'POST', null, null, (itcsData)=> {
-            console.log(cctvData.length);
             let cctvTotalData = [...cctvData];
-            console.log(itcsData.length);
             if (itcsData && itcsData.length > 0) {
                 itcsData.forEach((itcs)=>{
                     let obj = intersectionCameraTransferToCctv(itcs);

+ 6 - 1
src/main/resources/templates/admin/notice-view.html

@@ -237,15 +237,20 @@
         formData.append("bSubject", title);
         formData.append("bContent", content);
         formData.append("hmpgDsplEn", hmpgDsplEn);
-
+        const fileName = $('.attach.modify > div').text();
         if (file && file.name) {
             formData.append("attachFileNames", file.name + "||");
             formData.append("attachFile", file);
         }
+        else if(fileName && fileName !== '첨부파일 없음') {
+            formData.append("attachFileNames", fileName + '||');
+            formData.append("attachFile", null);
+        }
         else {
             formData.append("attachFile", null);
             formData.append("attachFileNames", "||");
         }
+
         $.ajax({
             url: '/api/notice/modifyNotice',
             processData : false,

+ 0 - 1
src/main/resources/templates/admin/popup-view.html

@@ -328,7 +328,6 @@
             fOnAppLoad: function () {
                 //기존 저장된 내용의 text 내용을 에디터상에 뿌려주고자 할때 사용
                 let content = popup.pcontent;
-                console.log(content);
                 if (content === null) {
                     content = "";
                 }

+ 16 - 2
src/main/resources/templates/notice/view.html

@@ -70,9 +70,9 @@
                 if (!ext) {
                     return alert("파일 확장자명이 잘못 되었습니다.");
                 }
-                const file = new Blob([attachFile], {type: "application/" + ext});
+                const file = b64ToBlob(attachFile);
                 const link = document.createElement('a');
-                link.href = window.URL.createObjectURL(file);
+                link.href = file;
                 link.download = fileName;
                 link.click();
             }
@@ -82,4 +82,18 @@
 
         }, null);
     }
+
+    const b64ToBlob = (byteData) => {
+        const byteCharacters = atob(byteData);
+        const byteNumbers = new Array(byteCharacters.length);
+        for (let i = 0; i < byteCharacters.length; i++) {
+            byteNumbers[i] = byteCharacters.charCodeAt(i);
+        }
+        const byteArray = new Uint8Array(byteNumbers);
+        const blob = new Blob([byteArray]);
+        const blobUrl = window.URL.createObjectURL(blob);
+
+        return blobUrl;
+    };
+
 </script>