+
+
+
+
-
+
+
-
-
- {{ title }}
-
-
- {{ content }}
-
-
- {{ date }}
-
-
+
+
+ {{ post.category }}
+
+
+
{{ post.title }}
+
+
{{ post.content }}
+
+
+
{{ formatDate(post.date) }}
+
+
+
+ {{ post.likes || 0 }}
+
+
+ {{ post.comments || 0 }}
+
+
+
@@ -25,41 +45,75 @@
-
diff --git a/src/router/index.js b/src/router/index.js
index 417ef6c..a19d7da 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -1,5 +1,4 @@
import { createRouter, createWebHistory } from 'vue-router'
-import BoardWrite from '@v/board/BoardWrite.vue';
// 초기 렌더링 속도를 위해 지연 로딩 사용
const routes = [
@@ -14,6 +13,7 @@ const routes = [
children: [
{
path: '',
+ name: 'BoardList',
component: () => import('@v/board/BoardList.vue')
},
{
@@ -21,8 +21,14 @@ const routes = [
component: () => import('@v/board/BoardWrite.vue')
},
{
- path: 'get/:id',
+ path: ':id',
+ name: 'BoardDetail',
component: () => import('@v/board/BoardView.vue')
+ },
+ {
+ path: 'edit/:id',
+ name: 'BoardEdit',
+ component: () => import('@v/board/BoardEdit.vue')
}
]
},
diff --git a/src/stores/calendarStore.js b/src/stores/calendarStore.js
index 80c8525..a3616f9 100644
--- a/src/stores/calendarStore.js
+++ b/src/stores/calendarStore.js
@@ -4,12 +4,12 @@ import axios from 'axios';
const events = ref([]);
const fetchEvents = async () => {
- const response = await axios.get('/api/calendar/events');
+ const response = await axios.get('/calendar/events');
events.value = response.data;
};
const addEvent = async (event) => {
- await axios.post('/api/calendar/event', event);
+ await axios.post('/calendar/event', event);
fetchEvents();
};
diff --git a/src/views/board/BoardEdit.vue b/src/views/board/BoardEdit.vue
new file mode 100644
index 0000000..36e81bd
--- /dev/null
+++ b/src/views/board/BoardEdit.vue
@@ -0,0 +1,154 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/board/BoardList.vue b/src/views/board/BoardList.vue
index 25109bd..691fdba 100644
--- a/src/views/board/BoardList.vue
+++ b/src/views/board/BoardList.vue
@@ -1,30 +1,30 @@
-
-
-
+
+
+
+
- 공지
- 자유
- 익명
-
-
- {{ item.viewCount }}
-
- {{ item.cmtCount }}
-
+ 공지
+ 자유
+ 익명
+
@@ -33,25 +33,36 @@
-
+
diff --git a/src/views/board/BoardView.vue b/src/views/board/BoardView.vue
index 890e036..87b2403 100644
--- a/src/views/board/BoardView.vue
+++ b/src/views/board/BoardView.vue
@@ -3,15 +3,27 @@
+
+
-
-
+
{{ boardTitle }}
+
+
+
+
+
+
+
@@ -22,15 +34,89 @@
+
diff --git a/src/views/board/BoardWrite.vue b/src/views/board/BoardWrite.vue
index b4b3c11..0538b8e 100644
--- a/src/views/board/BoardWrite.vue
+++ b/src/views/board/BoardWrite.vue
@@ -55,7 +55,7 @@ import FormSelect from '@c/input/FormSelect.vue';
import FormFile from '@c/input/FormFile.vue';
import { ref, watch } from 'vue';
import router from '@/router';
-import axios from 'axios';
+import axios from '@api';
const categoryList = ['자유', '익명', '공지사항'];
// input 경고문 만들어야함!!
@@ -111,7 +111,7 @@ const write = async () => {
};
// 게시물 작성 API 호출
- const { data: boardResponse } = await axios.post('/api/board', boardData);
+ const { data: boardResponse } = await axios.post('/board', boardData);
const boardId = boardResponse.data.boardId;
// 첨부파일 처리
@@ -135,7 +135,7 @@ const write = async () => {
formData.append("CMNFLESIZ", file.size); // 파일 크기
formData.append("CMNFLEREG", fileInfo.registrantId); // 등록자 ID
- const response = await axios.post(`/api/board/${boardId}/attachments`, formData, {
+ const response = await axios.post(`/board/${boardId}/attachments`, formData, {
headers: {
"Content-Type": "multipart/form-data",
},
diff --git a/vite.config.js b/vite.config.js
index 061e29f..f2428a4 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -8,7 +8,7 @@ export default defineConfig({
server: {
proxy: {
'/api': {
- target: 'http://localhost:10325', // Spring Boot 서버 주소
+ target: 'http://localhost:10325/api', // Spring Boot 서버 주소
changeOrigin: true,
},
},