
--- client/resources/api/user.js
+++ client/resources/api/user.js
... | ... | @@ -1,41 +1,39 @@ |
1 |
-import {apiClient} from "./index"; |
|
1 |
+import { apiClient } from "./index"; |
|
2 | 2 |
import store from '../../views/pages/AppStore'; |
3 | 3 |
|
4 | 4 |
// 로그인 |
5 | 5 |
export const loginProc = mber => { |
6 |
- return apiClient.post(`/user/login.json`, mber); |
|
6 |
+ return apiClient.post(`/user/login.json`, mber); |
|
7 | 7 |
} |
8 | 8 |
|
9 | 9 |
// 로그아웃 |
10 | 10 |
export const logOutProc = () => { |
11 |
- return apiClient.post(`/user/logout.json`, {}, { |
|
12 |
- headers: { |
|
13 |
- 'refresh': store.state.refresh |
|
14 |
- } |
|
15 |
- }); |
|
11 |
+ return apiClient.post(`/user/logout.json`, {}, { |
|
12 |
+ headers: { 'refresh': store.state.refresh } |
|
13 |
+ }); |
|
16 | 14 |
} |
17 | 15 |
|
18 | 16 |
// 아이디로 유저 찾기 |
19 | 17 |
export const findByIdProc = userId => { |
20 |
- return apiClient.get(`/user/${userId}/users.json`); |
|
18 |
+ return apiClient.get(`/user/${userId}/users.json`); |
|
21 | 19 |
} |
22 | 20 |
|
23 | 21 |
// 회원가입 |
24 | 22 |
export const join = mber => { |
25 |
- return apiClient.post(`/user/join.json`, mber); |
|
23 |
+ return apiClient.post(`/user/join.json`, mber); |
|
26 | 24 |
} |
27 | 25 |
|
28 | 26 |
// 유저 정보 변경 |
29 | 27 |
export const updateUsers = (userId, updateUserDTO) => { |
30 |
- return apiClient.put(`/user/${userId}/users.json`, updateUserDTO); |
|
28 |
+ return apiClient.put(`/user/${userId}/users.json`, updateUserDTO); |
|
31 | 29 |
} |
32 | 30 |
|
33 | 31 |
// 유저 비밀번호 변경 |
34 | 32 |
export const updatePassword = (userId, passwordDTO) => { |
35 |
- return apiClient.put(`/user/${userId}/updatePassword.json`, passwordDTO); |
|
33 |
+ return apiClient.put(`/user/${userId}/updatePassword.json`, passwordDTO); |
|
36 | 34 |
} |
37 | 35 |
|
38 | 36 |
// 유저저 목록 조회 (검색조건 있음) |
39 | 37 |
export const findAllUsers = searchReqDTO => { |
40 |
- return apiClient.get(`/user/users.json`, { params: searchReqDTO }); |
|
41 |
- }(파일 끝에 줄바꿈 문자 없음) |
|
38 |
+ return apiClient.get(`/user/users.json`, { params: searchReqDTO }); |
|
39 |
+}(파일 끝에 줄바꿈 문자 없음) |
--- client/resources/js/cmmnPlugin.js
+++ client/resources/js/cmmnPlugin.js
... | ... | @@ -1,3 +1,5 @@ |
1 |
+import store from '../../views/pages/AppStore' |
|
2 |
+ |
|
1 | 3 |
export default { |
2 | 4 |
install(Vue) { |
3 | 5 |
// 빈값체크 |
... | ... | @@ -32,8 +34,7 @@ |
32 | 34 |
try { |
33 | 35 |
// 브라우저 환경에서는 DOMParser 사용 |
34 | 36 |
const doc = new DOMParser().parseFromString(html, 'text/html'); |
35 |
- let text = doc.body.textContent || ''; |
|
36 |
- return text.replace(/\s+/g, ' ').trim(); |
|
37 |
+ return doc.body.textContent || ''; |
|
37 | 38 |
} catch (e) { |
38 | 39 |
// DOMParser 실패시 정규식 방식으로 폴백 |
39 | 40 |
console.warn('DOMParser failed, falling back to regex', e); |
... | ... | @@ -68,10 +69,33 @@ |
68 | 69 |
// 남은 이름 있는 엔티티 제거 (… 등) |
69 | 70 |
text = text.replace(/&[a-zA-Z]+;/g, ''); |
70 | 71 |
|
71 |
- // 연속된 공백 문자 하나로 처리 |
|
72 |
- text = text.replace(/\s+/g, ' ').trim(); |
|
73 |
- |
|
74 | 72 |
return text; |
75 | 73 |
}; |
76 |
- } |
|
74 |
+ |
|
75 |
+ // 게시물 권한 체크 |
|
76 |
+ Vue.config.globalProperties.$registerChk = (register) => { |
|
77 |
+ // 사용자 권한 확인 |
|
78 |
+ const roles = store.state.roles; |
|
79 |
+ if (roles != null && roles.length > 0) { |
|
80 |
+ for (let role of roles) { |
|
81 |
+ if (role.authority === 'ROLE_ADMIN') { |
|
82 |
+ return true; // 관리자인 경우 true 반환 |
|
83 |
+ } |
|
84 |
+ } |
|
85 |
+ } |
|
86 |
+ |
|
87 |
+ // 관리자가 아닌 경우 작성자 확인 |
|
88 |
+ const userId = store.state.userId; |
|
89 |
+ if (register === userId) { |
|
90 |
+ return true; // 작성자인 경우 true 반환 |
|
91 |
+ } else { |
|
92 |
+ return false; // 작성자가 아닌 경우 false 반환 |
|
93 |
+ } |
|
94 |
+ }; |
|
95 |
+ |
|
96 |
+ Vue.config.globalProperties.$processTitle = (title) => { |
|
97 |
+ if (!title) return ''; |
|
98 |
+ return title.trim().replace(/\s+/g, ' '); |
|
99 |
+ } |
|
100 |
+ }, |
|
77 | 101 |
}(파일 끝에 줄바꿈 문자 없음) |
--- client/resources/js/youtubeUtils.js
+++ client/resources/js/youtubeUtils.js
... | ... | @@ -43,6 +43,6 @@ |
43 | 43 |
export function getYouTubeThumbnail(url) { |
44 | 44 |
const videoId = extractYouTubeVideoId(url); |
45 | 45 |
if (!videoId) return ''; |
46 |
- // return `https://i.ytimg.com/vi/${videoId}/mqdefault.jpg`; // 기본 해상도 |
|
47 |
- return `https://i.ytimg.com/vi/${videoId}/maxresdefault.jpg`; // 고해상도 (지원 안되는 영상 있음) |
|
46 |
+ return `https://i.ytimg.com/vi/${videoId}/mqdefault.jpg`; // 기본 해상도 |
|
47 |
+ //return `https://i.ytimg.com/vi/${videoId}/maxresdefault.jpg`; // 고해상도 (지원 안되는 영상 있음) |
|
48 | 48 |
}(파일 끝에 줄바꿈 문자 없음) |
--- client/views/component/SearchFormComponent.vue
+++ client/views/component/SearchFormComponent.vue
... | ... | @@ -256,6 +256,16 @@ |
256 | 256 |
} |
257 | 257 |
} |
258 | 258 |
|
259 |
+ if (!this.$isEmpty(this.formData.startYear) && !this.$isEmpty(this.formData.endYear)) { |
|
260 |
+ const startYear = parseInt(this.formData.startYear); |
|
261 |
+ const endYear = parseInt(this.formData.endYear); |
|
262 |
+ |
|
263 |
+ if (startYear > endYear) { |
|
264 |
+ alert('종료 연도는 시작 연도보다 작을 수 없습니다.'); |
|
265 |
+ return; |
|
266 |
+ } |
|
267 |
+ } |
|
268 |
+ |
|
259 | 269 |
// 부모 컴포넌트에 이벤트 발생 (데이터 전달) |
260 | 270 |
this.$emit('search', JSON.parse(JSON.stringify(this.formData))); |
261 | 271 |
}, |
--- client/views/component/editor/EditorComponent.vue
+++ client/views/component/editor/EditorComponent.vue
... | ... | @@ -160,17 +160,8 @@ |
160 | 160 |
updateContents(data) { |
161 | 161 |
this.$emit('update:contents', data); |
162 | 162 |
|
163 |
- // 순수 텍스트 추출 (방법 2) |
|
164 |
- if (this.editorInstance) { |
|
165 |
- const plainText = Array.from(this.editorInstance.model.document.getRoot().getChildren()) |
|
166 |
- .map(rootChild => this.editorInstance.data.processor.toData( |
|
167 |
- this.editorInstance.editing.mapper.toViewElement(rootChild) |
|
168 |
- )) |
|
169 |
- .join('\n') |
|
170 |
- .replace(/<[^>]*>?/gm, ''); |
|
171 |
- |
|
172 |
- this.$emit('update:plainContents', plainText); |
|
173 |
- } |
|
163 |
+ const plainText = this.$stripHtml(data); |
|
164 |
+ this.$emit('update:plainContents', plainText); |
|
174 | 165 |
} |
175 | 166 |
} |
176 | 167 |
}; |
--- client/views/component/listLayout/CardStyleComponent.vue
+++ client/views/component/listLayout/CardStyleComponent.vue
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 |
<h5>{{ item.sj }}</h5> |
12 | 12 |
<p v-if="item.hasOwnProperty('adres')" class="address">{{ item.adres }}</p> |
13 | 13 |
<p class="text">{{ item.cn ? $stripHtml(item.cn) : '' }}</p> |
14 |
- <div class="mb-20"> |
|
14 |
+ <div class="mb-20" style="white-space: pre"> |
|
15 | 15 |
<ul class="category"> |
16 | 16 |
<li v-for="(ctgry, ctgryIdx) of item.ctgrys" :key="ctgryIdx" class="category1">{{ ctgry.ctgryNm }}</li> |
17 | 17 |
</ul> |
--- client/views/pages/bbsDcry/photo/PicHistoryDetail.vue
+++ client/views/pages/bbsDcry/photo/PicHistoryDetail.vue
... | ... | @@ -85,8 +85,8 @@ |
85 | 85 |
</dl> |
86 | 86 |
</form> |
87 | 87 |
<div class="btn-group flex-center"> |
88 |
- <button class="red-line " type="button" @click="fnDelete">삭제</button> |
|
89 |
- <button class="blue-line " type="button" @click="fnMoveTo('edit', pageId)">수정</button> |
|
88 |
+ <button v-if="isRegister" class="red-line " type="button" @click="fnDelete">삭제</button> |
|
89 |
+ <button v-if="isRegister" class="blue-line " type="button" @click="fnMoveTo('edit', pageId)">수정</button> |
|
90 | 90 |
<button class="gray-line-bg " type="button" @click="fnMoveTo('list')">목록</button> |
91 | 91 |
</div> |
92 | 92 |
</div> |
... | ... | @@ -149,6 +149,8 @@ |
149 | 149 |
loading: false, |
150 | 150 |
|
151 | 151 |
activeIndex: 0, |
152 |
+ |
|
153 |
+ isRegister: false, |
|
152 | 154 |
}; |
153 | 155 |
}, |
154 | 156 |
|
... | ... | @@ -179,6 +181,7 @@ |
179 | 181 |
alert('올바른 접근이 아닙니다.'); |
180 | 182 |
this.fnMoveTo('list'); // 목록으로 이동 |
181 | 183 |
} |
184 |
+ this.isRegister = this.$registerChk(this.findResult.register); |
|
182 | 185 |
} catch (error) { |
183 | 186 |
alert('조회중 오류가 발생했습니다.'); |
184 | 187 |
this.fnMoveTo('list'); |
--- client/views/pages/bbsDcry/photo/PicHistoryInsert.vue
+++ client/views/pages/bbsDcry/photo/PicHistoryInsert.vue
... | ... | @@ -55,7 +55,7 @@ |
55 | 55 |
</div> |
56 | 56 |
</li> |
57 | 57 |
<li class="file-insert"> |
58 |
- <input type="file" id="fileInput" class="file-input" multiple accept="image/jpeg,image/png,image/gif,image/jpg" @change="handleFileSelect"> |
|
58 |
+ <input type="file" id="fileInput" ref="fileInput" class="file-input" multiple accept="image/jpeg,image/png,image/gif,image/jpg" @change="handleFileSelect"> |
|
59 | 59 |
<label for="fileInput" class="file-label mb-20" @dragover.prevent="handleDragOver" @dragleave.prevent="handleDragLeave" @drop.prevent="handleDrop" :class="{ 'drag-over': isDragging }"> |
60 | 60 |
<div class="flex-center align-center"> |
61 | 61 |
<img :src="fileicon" alt=""> |
... | ... | @@ -322,6 +322,11 @@ |
322 | 322 |
fnDelFile(type, separator) { |
323 | 323 |
if (type === 'new') { |
324 | 324 |
this.multipartFiles.splice(separator, 1); |
325 |
+ |
|
326 |
+ // 모든 새 파일이 삭제된 경우 input 요소 초기화 |
|
327 |
+ if (this.multipartFiles.length === 0) { |
|
328 |
+ this.$refs.fileInput.value = ''; |
|
329 |
+ } |
|
325 | 330 |
} else if (type === 'old') { |
326 | 331 |
this.requestDTO.files = this.requestDTO.files.filter(item => item.fileOrdr !== separator); |
327 | 332 |
} |
... | ... | @@ -357,6 +362,10 @@ |
357 | 362 |
|
358 | 363 |
// 등록 |
359 | 364 |
async submitForm() { |
365 |
+ // 공백제거 |
|
366 |
+ this.requestDTO.sj = this.$processTitle(this.requestDTO.sj); |
|
367 |
+ this.requestDTO.adres = this.$processTitle(this.requestDTO.adres); |
|
368 |
+ |
|
360 | 369 |
// 유효성 검사 |
361 | 370 |
if (this.$isEmpty(this.requestDTO.sj)) { |
362 | 371 |
alert("제목을 입력해 주세요."); |
... | ... | @@ -473,6 +482,9 @@ |
473 | 482 |
}; |
474 | 483 |
|
475 | 484 |
if (routes[type]) { |
485 |
+ if (!this.$isEmpty(this.pageId) && type === 'list') { |
|
486 |
+ this.$router.push({ name: 'PicHistoryDetail', query: { id: this.pageId } }); |
|
487 |
+ } |
|
476 | 488 |
this.$router.push(routes[type]); |
477 | 489 |
} else { |
478 | 490 |
alert("올바르지 않은 경로를 요청하여 목록으로 이동합니다."); |
--- client/views/pages/bbsDcry/video/VideoHistoryDetail.vue
+++ client/views/pages/bbsDcry/video/VideoHistoryDetail.vue
... | ... | @@ -58,8 +58,8 @@ |
58 | 58 |
</dl> |
59 | 59 |
</form> |
60 | 60 |
<div class="btn-group flex-center"> |
61 |
- <button type="button" class="red-line" @click="fnDelete">삭제</button> |
|
62 |
- <button type="button" class="blue-line" @click="fnMoveTo('edit', pageId)">수정</button> |
|
61 |
+ <button v-if="isRegister" type="button" class="red-line" @click="fnDelete">삭제</button> |
|
62 |
+ <button v-if="isRegister" type="button" class="blue-line" @click="fnMoveTo('edit', pageId)">수정</button> |
|
63 | 63 |
<button type="button" class="gray-line-bg" @click="fnMoveTo('list')">목록</button> |
64 | 64 |
<button type="button" class="gradient" @click="fnDownload">다운로드</button> |
65 | 65 |
<div v-if="loading" class="loading-overlay"> |
... | ... | @@ -98,6 +98,8 @@ |
98 | 98 |
findResult: {}, |
99 | 99 |
selectedFiles: [], |
100 | 100 |
loading: false, |
101 |
+ |
|
102 |
+ isRegister: false, |
|
101 | 103 |
}; |
102 | 104 |
}, |
103 | 105 |
|
... | ... | @@ -124,6 +126,7 @@ |
124 | 126 |
alert('올바른 접근이 아닙니다.'); |
125 | 127 |
this.fnMoveTo('list'); // 목록으로 이동 |
126 | 128 |
} |
129 |
+ this.isRegister = this.$registerChk(this.findResult.register); |
|
127 | 130 |
} catch (error) { |
128 | 131 |
alert('조회중 오류가 발생했습니다.'); |
129 | 132 |
this.fnMoveTo('list'); |
--- client/views/pages/bbsDcry/video/VideoHistoryInsert.vue
+++ client/views/pages/bbsDcry/video/VideoHistoryInsert.vue
... | ... | @@ -248,7 +248,7 @@ |
248 | 248 |
// 유효성 검사 |
249 | 249 |
if ((files.length + this.multipartFiles.length + this.requestDTO.files.length) > 1) { |
250 | 250 |
alert("영상 파일은 한 개만 등록 가능합니다."); |
251 |
- this.resetFileInput(); |
|
251 |
+ this.resetFileInput(); // input 파일 목록 비움 |
|
252 | 252 |
return; |
253 | 253 |
} |
254 | 254 |
|
... | ... | @@ -258,14 +258,14 @@ |
258 | 258 |
// 파일 타입 검증 |
259 | 259 |
if (!allowedTypes.includes(fileType)) { |
260 | 260 |
alert(`${file.name} 파일은 허용되지 않는 형식입니다. 영상 파일(mp4, mov, avi, wmv, mkv, webm)만 업로드 가능합니다.`); |
261 |
- this.resetFileInput(); |
|
261 |
+ this.resetFileInput(); // input 파일 목록 비움 |
|
262 | 262 |
return; |
263 | 263 |
} |
264 | 264 |
|
265 | 265 |
// 파일 크기 제한 검증 |
266 | 266 |
if (file.size > maxSize) { |
267 | 267 |
alert(`${file.name} 파일이 10GB를 초과합니다.`); |
268 |
- this.resetFileInput(); |
|
268 |
+ this.resetFileInput(); // input 파일 목록 비움 |
|
269 | 269 |
return; |
270 | 270 |
} |
271 | 271 |
|
... | ... | @@ -284,6 +284,11 @@ |
284 | 284 |
fnDelFile(type, separator) { |
285 | 285 |
if (type === 'new') { |
286 | 286 |
this.multipartFiles.splice(separator, 1); |
287 |
+ |
|
288 |
+ // 모든 새 파일이 삭제된 경우 input 요소 초기화 |
|
289 |
+ if (this.multipartFiles.length === 0) { |
|
290 |
+ this.resetFileInput(); // input 파일 목록 비움 |
|
291 |
+ } |
|
287 | 292 |
} else if (type === 'old') { |
288 | 293 |
this.requestDTO.files = this.requestDTO.files.filter(item => item.fileOrdr !== separator); |
289 | 294 |
} |
... | ... | @@ -291,6 +296,9 @@ |
291 | 296 |
|
292 | 297 |
// 등록 |
293 | 298 |
async submitForm() { |
299 |
+ // 공백제거 |
|
300 |
+ this.requestDTO.sj = this.$processTitle(this.requestDTO.sj); |
|
301 |
+ this.requestDTO.adres = this.$processTitle(this.requestDTO.adres); |
|
294 | 302 |
// 유효성 검사 |
295 | 303 |
if (this.$isEmpty(this.requestDTO.sj)) { |
296 | 304 |
alert("제목을 입력해 주세요."); |
... | ... | @@ -398,6 +406,9 @@ |
398 | 406 |
}; |
399 | 407 |
|
400 | 408 |
if (routes[type]) { |
409 |
+ if (!this.$isEmpty(this.pageId) && type === 'list') { |
|
410 |
+ this.$router.push({ name: 'PicHistoryDetail', query: { id: this.pageId } }); |
|
411 |
+ } |
|
401 | 412 |
this.$router.push(routes[type]); |
402 | 413 |
} else { |
403 | 414 |
alert("올바르지 않은 경로를 요청하여 목록으로 이동합니다."); |
--- client/views/pages/bbsMediaVido/MediaVideoDetail.vue
+++ client/views/pages/bbsMediaVido/MediaVideoDetail.vue
... | ... | @@ -57,8 +57,8 @@ |
57 | 57 |
</dl> |
58 | 58 |
</form> |
59 | 59 |
<div class="btn-group flex-center"> |
60 |
- <button class="red-line " type="button" @click="fnDelete">삭제</button> |
|
61 |
- <button class="blue-line " type="button" @click="fnMoveTo('edit', pageId)">수정</button> |
|
60 |
+ <button v-if="isRegister" class="red-line " type="button" @click="fnDelete">삭제</button> |
|
61 |
+ <button v-if="isRegister" class="blue-line " type="button" @click="fnMoveTo('edit', pageId)">수정</button> |
|
62 | 62 |
<button class="gray-line-bg " type="button" @click="fnMoveTo('list')">목록</button> |
63 | 63 |
</div> |
64 | 64 |
</div> |
... | ... | @@ -91,6 +91,8 @@ |
91 | 91 |
pageId: null, |
92 | 92 |
findResult: {}, |
93 | 93 |
selectedFiles: [], |
94 |
+ |
|
95 |
+ isRegister: false, |
|
94 | 96 |
}; |
95 | 97 |
}, |
96 | 98 |
|
... | ... | @@ -112,6 +114,7 @@ |
112 | 114 |
try { |
113 | 115 |
const response = await findMediaVidoProc(this.pageId); |
114 | 116 |
this.findResult = response.data.data.mediaVido; |
117 |
+ this.isRegister = this.$registerChk(this.findResult.register); |
|
115 | 118 |
} catch (error) { |
116 | 119 |
alert('조회중 오류가 발생했습니다.'); |
117 | 120 |
this.fnMoveTo('list'); |
--- client/views/pages/bbsMediaVido/MediaVideoInsert.vue
+++ client/views/pages/bbsMediaVido/MediaVideoInsert.vue
... | ... | @@ -159,6 +159,8 @@ |
159 | 159 |
|
160 | 160 |
// 등록 |
161 | 161 |
async submitForm() { |
162 |
+ // 공백제거 |
|
163 |
+ this.requestDTO.sj = this.$processTitle(this.requestDTO.sj); |
|
162 | 164 |
// 유효성 검사 |
163 | 165 |
if (this.$isEmpty(this.requestDTO.sj)) { |
164 | 166 |
alert("제목을 입력해 주세요."); |
... | ... | @@ -215,6 +217,9 @@ |
215 | 217 |
}; |
216 | 218 |
|
217 | 219 |
if (routes[type]) { |
220 |
+ if (!this.$isEmpty(this.pageId) && type === 'list') { |
|
221 |
+ this.$router.push({ name: 'PicHistoryDetail', query: { id: this.pageId } }); |
|
222 |
+ } |
|
218 | 223 |
this.$router.push(routes[type]); |
219 | 224 |
} else { |
220 | 225 |
alert("올바르지 않은 경로를 요청하여 목록으로 이동합니다."); |
--- client/views/pages/bbsNesDta/NewsReleaseDetail.vue
+++ client/views/pages/bbsNesDta/NewsReleaseDetail.vue
... | ... | @@ -35,7 +35,7 @@ |
35 | 35 |
<dd class="mb-20"> |
36 | 36 |
<img :src="addressicon" alt=""> |
37 | 37 |
<span>링크</span> |
38 |
- <p>{{ findResult.link }}</p> |
|
38 |
+ <p><a :href="findResult.link" target="_blank">{{ findResult.link }}</a></p> |
|
39 | 39 |
</dd> |
40 | 40 |
<dd class="mb-20"> |
41 | 41 |
<img :src="yearicon" alt=""> |
... | ... | @@ -63,8 +63,8 @@ |
63 | 63 |
</dl> |
64 | 64 |
</form> |
65 | 65 |
<div class="btn-group flex-center"> |
66 |
- <button class="red-line " type="button" @click="fnDelete">삭제</button> |
|
67 |
- <button class="blue-line " type="button" @click="fnMoveTo('edit', pageId)">수정</button> |
|
66 |
+ <button v-if="isRegister" class="red-line " type="button" @click="fnDelete">삭제</button> |
|
67 |
+ <button v-if="isRegister" class="blue-line " type="button" @click="fnMoveTo('edit', pageId)">수정</button> |
|
68 | 68 |
<button class="gray-line-bg " type="button" @click="fnMoveTo('list')">목록</button> |
69 | 69 |
</div> |
70 | 70 |
</div> |
... | ... | @@ -95,6 +95,8 @@ |
95 | 95 |
pageId: null, |
96 | 96 |
findResult: {}, |
97 | 97 |
selectedFiles: [], |
98 |
+ |
|
99 |
+ isRegister: false, |
|
98 | 100 |
}; |
99 | 101 |
}, |
100 | 102 |
|
... | ... | @@ -116,6 +118,7 @@ |
116 | 118 |
try { |
117 | 119 |
const response = await findNesDtaProc(this.pageId); |
118 | 120 |
this.findResult = response.data.data.nesDta; |
121 |
+ this.isRegister = this.$registerChk(this.findResult.register); |
|
119 | 122 |
} catch (error) { |
120 | 123 |
alert('조회중 오류가 발생했습니다.'); |
121 | 124 |
|
--- client/views/pages/bbsNesDta/NewsReleaseInsert.vue
+++ client/views/pages/bbsNesDta/NewsReleaseInsert.vue
... | ... | @@ -233,7 +233,7 @@ |
233 | 233 |
// 유효성 검사 |
234 | 234 |
if ((files.length + this.multipartFiles.length + this.requestDTO.files.length) > 1) { |
235 | 235 |
alert("썸네일은 한 개만 등록 가능합니다."); |
236 |
- this.resetFileInput(); |
|
236 |
+ this.resetFileInput(); // input 파일 목록 비움 |
|
237 | 237 |
return; |
238 | 238 |
} |
239 | 239 |
|
... | ... | @@ -243,14 +243,14 @@ |
243 | 243 |
// 파일 타입 검증 |
244 | 244 |
if (!allowedTypes.includes(fileType)) { |
245 | 245 |
alert(`${file.name} 파일은 허용되지 않는 형식입니다. 이미지 파일(jpg, jpeg, png, gif)만 업로드 가능합니다.`); |
246 |
- this.resetFileInput(); |
|
246 |
+ this.resetFileInput(); // input 파일 목록 비움 |
|
247 | 247 |
return; |
248 | 248 |
} |
249 | 249 |
|
250 | 250 |
// 파일 크기 제한 검증 |
251 | 251 |
if (file.size > maxSize) { |
252 | 252 |
alert(`${file.name} 파일이 10GB를 초과합니다.`); |
253 |
- this.resetFileInput(); |
|
253 |
+ this.resetFileInput(); // input 파일 목록 비움 |
|
254 | 254 |
return; |
255 | 255 |
} |
256 | 256 |
|
... | ... | @@ -269,6 +269,11 @@ |
269 | 269 |
fnDelFile(type, separator) { |
270 | 270 |
if (type === 'new') { |
271 | 271 |
this.multipartFiles.splice(separator, 1); |
272 |
+ |
|
273 |
+ // 모든 새 파일이 삭제된 경우 input 요소 초기화 |
|
274 |
+ if (this.multipartFiles.length === 0) { |
|
275 |
+ this.resetFileInput(); // input 파일 목록 비움 |
|
276 |
+ } |
|
272 | 277 |
} else if (type === 'old') { |
273 | 278 |
this.requestDTO.files = this.requestDTO.files.filter(item => item.fileId !== separator); |
274 | 279 |
} |
... | ... | @@ -276,6 +281,8 @@ |
276 | 281 |
|
277 | 282 |
// 등록 |
278 | 283 |
async submitForm() { |
284 |
+ // 공백제거 |
|
285 |
+ this.requestDTO.sj = this.$processTitle(this.requestDTO.sj); |
|
279 | 286 |
// 유효성 검사 |
280 | 287 |
if (this.$isEmpty(this.requestDTO.sj)) { |
281 | 288 |
alert("제목을 입력해 주세요."); |
... | ... | @@ -378,6 +385,9 @@ |
378 | 385 |
}; |
379 | 386 |
|
380 | 387 |
if (routes[type]) { |
388 |
+ if (!this.$isEmpty(this.pageId) && type === 'list') { |
|
389 |
+ this.$router.push({ name: 'PicHistoryDetail', query: { id: this.pageId } }); |
|
390 |
+ } |
|
381 | 391 |
this.$router.push(routes[type]); |
382 | 392 |
} else { |
383 | 393 |
alert("올바르지 않은 경로를 요청하여 목록으로 이동합니다."); |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?