diff --git a/src/axios-interceptor.js b/src/axios-interceptor.js index 7071d24..39caef9 100644 --- a/src/axios-interceptor.js +++ b/src/axios-interceptor.js @@ -1,52 +1,50 @@ import axios from "axios" import sweetAlert from './util/modal.js' -var apiClient = null; +var apiClient = null apiClient = axios.create({ // baseURL: "//" + "192.168.1.116:8881/codesparring", baseURL: import.meta.env.VITE_BACK_URL, withCredentials: true - }); + }) apiClient.interceptors.request.use( function (config) { // config.headers["Content-Type"] = "application/json"; // config.headers["Content-Type"] = "multipart/form-data"; - config.headers["Authorization"] = `Bearer ${sessionStorage.getItem('accessToken')}`; - return config; + config.headers["Authorization"] = `Bearer ${sessionStorage.getItem('accessToken')}` + return config } ) apiClient.interceptors.response.use(res => { - if (!(res.status === 200 || res.status === 201 || res.status === 204)) throw new Error(); - if (res.data.errors) throw new Error(res.data.errors); + if (!(res.status === 200 || res.status === 201 || res.status === 204)) throw new Error() + if (res.data.errors) throw new Error(res.data.errors) - return res; + return res } ,async (error) => { if (error.response?.status === 401) { sweetAlert.warning("로그인이 필요합니다", '', '로그인창으로 가기').then(() =>{ - window.location.href='/login'; + window.location.href='/login' }) } if (error.response?.status === 403) { - console.error("403 Forbidden 에러 발생 :", error.response); + console.error("403 Forbidden 에러 발생 :", error.response) sweetAlert.error("권한이 없습니다", '', '뒤로 가기').then(() =>{ - window.history.back(); + window.history.back() }) } if (error.response?.status === 500) { console.error("500 Internal Server Error 발생 :", error.response) - sweetAlert.error("오류가 발생했습니다", '', '닫기').then(() =>{ - // window.history.back(); + sweetAlert.error(error.response.data.errors[0], '', '닫기').then(() =>{ }) - } - return Promise.reject(error); + return Promise.reject(error) } // ,async (error) => { @@ -94,4 +92,4 @@ apiClient.interceptors.response.use(res => { // } ); -export {apiClient}; \ No newline at end of file +export {apiClient} \ No newline at end of file diff --git a/src/components/admin/AdminReportPage.vue b/src/components/admin/AdminReportPage.vue index 1a49ec8..5c1ed92 100644 --- a/src/components/admin/AdminReportPage.vue +++ b/src/components/admin/AdminReportPage.vue @@ -26,7 +26,6 @@ - {{ totalPage }} : {{ startPage }} : {{ endPage }}
    - +
- - @@ -54,12 +51,11 @@ export default { currentPage: 1, startPage: '', endPage: '', - totalPage: '', + totalPages: '', reportModal: false, } }, mounted() { - console.log(this.$route.params.filter) const filter = this.$route.params.filter if (filter == 'all') { const onBt = document.getElementById('report-all') @@ -83,12 +79,13 @@ export default { .then((res) => { console.log(res.data) this.reportList = res.data.content - this.totalPage = res.data.totalPages - this.startPage = Math.floor((this.currentPage - 1) / 5) * 5 + 1; - this.endPage = Math.ceil(res.data.totalElements / 10); + this.totalPages = res.data.totalPages + this.startPage = Math.floor((this.currentPage - 1) / 5) * 5 + 1 + this.endPage = Math.min(this.startPage + 4, this.totalPages) + }) .catch((error) => { - console.error('Error fetching reports:', error.message); + console.error('Error fetching reports:', error.message) // alert('신고목록을 조회할 수 없습니다') }) } else if (filter == 'unprocessed') { @@ -112,23 +109,22 @@ export default { }) .then((res) => { this.reportList = res.data.content - this.startPage = Math.floor((this.currentPage - 1) / 5) * 5 + 1; - this.endPage = Math.ceil(res.data.totalElements / 10); - this.totalPage = res.data.totalPages; - + this.totalPages = res.data.totalPages + this.startPage = Math.floor((this.currentPage - 1) / 5) * 5 + 1 + this.endPage = Math.min(this.startPage + 4, this.totalPages) }) .catch(() => { - window.history.back() + console.error('Error fetching reports:', error.message) }) + } }, methods: { handleReportDeleted() { - const index = this.reportList.findIndex((report) => report.reportNo === this.selectedReportNo); + const index = this.reportList.findIndex((report) => report.reportNo === this.selectedReportNo) if (index !== -1) { - this.reportList.splice(index, 1); + this.reportList.splice(index, 1) } - }, allReport() { location.href = '/admin/report/all/1' @@ -138,32 +134,32 @@ export default { }, searchReport(e) { if (this.reportModal) { - if (e.target.id == 'search-icon') return; - const onBt = document.getElementById('report-all'); - onBt.style.opacity = '100%'; - this.reportModal = false; + if (e.target.id == 'search-icon') return + const onBt = document.getElementById('report-all') + onBt.style.opacity = '100%' + this.reportModal = false } else { if (e.target.id == 'search-icon') { - const onBt = document.getElementById('report-all'); - onBt.style.opacity = '50%'; - const offBt = document.getElementById('report-upc'); - offBt.style.opacity = '50%'; - this.reportModal = false; - - const searchText = document.getElementById('search-text').value; - const filteredReports = this.reportList.filter(report => report.reportNo == searchText); - this.reportList = filteredReports; + const onBt = document.getElementById('report-all') + onBt.style.opacity = '50%' + const offBt = document.getElementById('report-upc') + offBt.style.opacity = '50%' + this.reportModal = false + + const searchText = document.getElementById('search-text').value + const filteredReports = this.reportList.filter(report => report.reportNo == searchText) + this.reportList = filteredReports } } }, - pgClick(e) { - const pg = parseInt(e.target.id.replace("pg", "")); - this.currentPage = pg; + const pg = parseInt(e.target.id.replace("pg", "")) + this.currentPage = pg const filter = this.$route.params.filter location.href = '/admin/report/' + filter + '/' + this.currentPage }, + pgPrevClick() { this.currentPage = Math.floor(((this.currentPage - 1) / 5)) * 5 const filter = this.$route.params.filter @@ -178,24 +174,25 @@ export default { formatReportType(reportType) { switch (reportType) { case 1: - return '테스트케이스 추가요청'; + return '테스트케이스 추가요청' case 2: - return '문제 오류 제보'; + return '문제 오류 제보' case 3: - return '기타'; + return '기타' } }, reportView(report) { console.log(report.reportNo) - this.selectedReportNo = report.reportNo; + this.selectedReportNo = report.reportNo this.reportModal = true }, offReportModal() { this.reportModal = false }, } -}; +} + diff --git a/src/components/profile/ProfileEdit.vue b/src/components/profile/ProfileEdit.vue index 3f94907..66667f8 100644 --- a/src/components/profile/ProfileEdit.vue +++ b/src/components/profile/ProfileEdit.vue @@ -1,8 +1,343 @@ \ No newline at end of file + + + \ No newline at end of file diff --git a/src/views/member/ProfileImgPopup.vue b/src/components/profile/ProfileImgPopup.vue similarity index 71% rename from src/views/member/ProfileImgPopup.vue rename to src/components/profile/ProfileImgPopup.vue index d443bca..e2934b6 100644 --- a/src/views/member/ProfileImgPopup.vue +++ b/src/components/profile/ProfileImgPopup.vue @@ -1,32 +1,32 @@ @@ -37,7 +37,7 @@ export default { top: 50%; left: 50%; transform: translate(-50%, -50%); - background-color: var(--main2-color); + background-color: var(--white-color); padding: 15px; border: 1px solid #ccc; border-radius: 8px; @@ -76,5 +76,13 @@ body { .close-button { margin-top: 8px; padding: 5px; + color: var(--main1-color); + background-color: var(--main4-color); + border-color: var(--main4-color); + + &:hover { + background-color: var(--main4-hover-color); + border-color: var(--main4-hover-color); + } } - + \ No newline at end of file diff --git a/src/components/profile/ProfileRemove.vue b/src/components/profile/ProfileRemove.vue new file mode 100644 index 0000000..b161eac --- /dev/null +++ b/src/components/profile/ProfileRemove.vue @@ -0,0 +1,186 @@ + + + + + \ No newline at end of file diff --git a/src/components/report/AddReport.vue b/src/components/report/AddReport.vue index 7a2c959..48c6d0b 100644 --- a/src/components/report/AddReport.vue +++ b/src/components/report/AddReport.vue @@ -19,9 +19,9 @@
-
- +
+
@@ -41,19 +41,19 @@ export default { }, methods: { closeModal() { - this.$emit('close-modal'); + this.$emit('close-modal') }, addReprot() { if (!this.reportType) { sweetAlert.warning('신고사유을 선택해주세요!', '', '확인')(() =>{ - this.$refs.reportTypeInput.focus(); - return; + this.$refs.reportTypeInput.focus() + return }) } if (!this.reportContent) { sweetAlert.warning('신고내용을 입력해주세요!', '', '확인')(() =>{ - this.$refs.reportContentInput.focus(); - return; + this.$refs.reportContentInput.focus() + return }) } const url=`${this.backURL}/report` @@ -70,7 +70,7 @@ export default { }) .then(() => { sweetAlert.success("신고제출이 완료되었습니다", "", "확인") - this.$emit('close-modal'); + this.$emit('close-modal') }).catch(()=>{ sweetAlert.warning("신고제출이 실패하였습니다", "", "확인") }) @@ -129,9 +129,11 @@ textarea.report-title { gap: 8px; } -#bt-area { +.button-container { + grid-area: button-container; display: flex; justify-content: center; + gap: 10px; } button { @@ -145,7 +147,6 @@ button { #cancle-bt { background-color: var(--red-color); border-color: var(--red-color); - margin-right: 10px; &:hover { background-color: var(--red-hover-color); diff --git a/src/components/report/AddReportComment.vue b/src/components/report/AddReportComment.vue index ca21f9d..a6893bf 100644 --- a/src/components/report/AddReportComment.vue +++ b/src/components/report/AddReportComment.vue @@ -1,14 +1,15 @@ + \ No newline at end of file diff --git a/src/views/member/MyPage.vue b/src/views/member/MyPage.vue index 40cb790..29d6d83 100644 --- a/src/views/member/MyPage.vue +++ b/src/views/member/MyPage.vue @@ -3,7 +3,6 @@
마이페이지
-
내 정보 확인
@@ -11,16 +10,10 @@
제출한 코드
랭크 전적
- home - + home +
-
@@ -28,6 +21,9 @@
+ +
+ + \ No newline at end of file