From 9b3f09bcb470f534d8ec6ad3c76bc9f8489101dc Mon Sep 17 00:00:00 2001 From: seorang42 Date: Thu, 13 Feb 2025 10:13:07 +0900 Subject: [PATCH 1/6] =?UTF-8?q?:bug:=20[fix]=20=EB=B9=84=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8=20=EC=9C=A0=EC=A0=80=20=EB=A3=A8=ED=8A=B8=20=EB=94=94?= =?UTF-8?q?=EB=A0=89=ED=86=A0=EB=A6=AC=EB=A1=9C=20=EC=9D=B4=EB=8F=99=20?= =?UTF-8?q?=EC=8B=9C=20=EB=AA=A8=EB=8B=AC=20=ED=91=9C=EC=8B=9C=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/constants/common.ts | 46 ++++++++++++++++++++--------------------- src/router/index.ts | 13 ++++++------ 2 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/constants/common.ts b/src/constants/common.ts index 2c94291..537eea8 100644 --- a/src/constants/common.ts +++ b/src/constants/common.ts @@ -40,32 +40,32 @@ export const COLOR_LIST = [ ] export const PERMITTED_URL = { - UNKNOWN: ['login', 'pw-change-email'], - ROLE_USER: ['my-request', 'task-request', 'edit-information', 'pw-change'], + UNKNOWN: ['/login', '/pw-change-email'], + ROLE_USER: ['/my-request', '/task-request', '/edit-information', '/pw-change'], ROLE_MANAGER: [ - 'my-task', - 'task-board', - 'team-board', - 'statistics', - 'my-request', - 'task-request', - 'requested', - 'request-approve', - 'request-history', - 'edit-information', - 'pw-change' + '/my-task', + '/task-board', + '/team-board', + '/statistics', + '/my-request', + '/task-request', + '/requested', + '/request-approve', + '/request-history', + '/edit-information', + '/pw-change' ], ROLE_ADMIN: [ - 'member-management', - 'user-registration', - 'user-update', - 'task-management', - 'category-first', - 'category-second', - 'login-logs', - 'api-logs', - 'edit-information', - 'pw-change' + '/member-management', + '/user-registration', + '/user-update', + '/task-management', + '/category-first', + '/category-second', + '/login-logs', + '/api-logs', + '/edit-information', + '/pw-change' ] } diff --git a/src/router/index.ts b/src/router/index.ts index 0cbe519..b4d4601 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -137,25 +137,26 @@ router.beforeEach(async (to, from, next) => { await memberStore.updateMemberInfoWithToken() const { info } = memberStore - const originUrl = to.path.split('/')[1] - const redirectMap = { ROLE_USER: '/my-request', ROLE_MANAGER: '/my-task', ROLE_ADMIN: '/member-management' } - if ((info.role && to.path === '/login') || (info.role && to.path === '/')) { + if ((info.role && PERMITTED_URL.UNKNOWN.includes(to.path)) || (info.role && to.path === '/')) { return next(redirectMap[info.role]) } if (!info.role) { - if (PERMITTED_URL.UNKNOWN.includes(originUrl)) { + if (PERMITTED_URL.UNKNOWN.includes(to.path)) { return next() } if (to.path === '/login') { return next() } + if (to.path === '/') { + return next('/login') + } setError('로그인이 필요합니다') return next('/login') } @@ -166,11 +167,11 @@ router.beforeEach(async (to, from, next) => { ROLE_ADMIN: PERMITTED_URL.ROLE_ADMIN } - if (from.path === redirectMap[info.role] && !permittedUrlMap[info.role].includes(originUrl)) { + if (from.path === redirectMap[info.role] && !permittedUrlMap[info.role].includes(to.path)) { return false } - if (!permittedUrlMap[info.role].includes(originUrl)) { + if (!permittedUrlMap[info.role].includes(to.path)) { if (to.path === redirectMap[info.role]) { return next() } From cb4868d72bf3414cd90e6091ccc7af0a59772572 Mon Sep 17 00:00:00 2001 From: seorang42 Date: Thu, 13 Feb 2025 10:44:47 +0900 Subject: [PATCH 2/6] =?UTF-8?q?:bug:=20[fix]=20=EA=B4=80=EB=A6=AC=EC=9E=90?= =?UTF-8?q?=EA=B0=80=20=EB=B3=B8=EC=9D=B8=EC=9D=98=20=EA=B3=84=EC=A0=95?= =?UTF-8?q?=EC=9D=84=20=EC=82=AD=EC=A0=9C=ED=95=98=EB=8A=94=20=EA=B2=83=20?= =?UTF-8?q?=EB=B0=A9=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/ModalView.vue | 2 +- .../member-management/MemberManagementListCard.vue | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/common/ModalView.vue b/src/components/common/ModalView.vue index 93acc36..a539bca 100644 --- a/src/components/common/ModalView.vue +++ b/src/components/common/ModalView.vue @@ -27,7 +27,7 @@
diff --git a/src/components/member-management/MemberManagementListCard.vue b/src/components/member-management/MemberManagementListCard.vue index 9f9396c..ef5f874 100644 --- a/src/components/member-management/MemberManagementListCard.vue +++ b/src/components/member-management/MemberManagementListCard.vue @@ -58,6 +58,9 @@ import { useRouter } from 'vue-router' import ResultModal from '../common/ResultModal.vue' import ListCardTab from '../lists/ListCardTab.vue' import ModalView from '../common/ModalView.vue' +import { useMemberStore } from '@/stores/member' +import { storeToRefs } from 'pinia' +import { useErrorStore } from '@/stores/error' const roleContent = (role: Role) => { return role === 'ROLE_USER' ? '사용자' : role === 'ROLE_MANAGER' ? '담당자' : '관리자' @@ -84,7 +87,14 @@ const isModalVisible = ref({ }) const resultModalType = ref('') const message = ref('') +const memberStore = useMemberStore() +const { info: myInfo } = storeToRefs(memberStore) +const { setError } = useErrorStore() const toggleModal = (key: keyof typeof isModalVisible.value) => { + if (key === 'delete' && info.nickname === myInfo.value.nickname) { + setError('자신의 계정은\n삭제할 수 없습니다') + return + } isModalVisible.value = Object.fromEntries( Object.keys(isModalVisible.value).map(k => [k, k === key]) ) as typeof isModalVisible.value From 0260502893c8699cff0e8cc72d8cd28dffc0116d Mon Sep 17 00:00:00 2001 From: seorang42 Date: Thu, 13 Feb 2025 11:29:20 +0900 Subject: [PATCH 3/6] =?UTF-8?q?:bug:=20[fix]=20Input=20Validation=20Border?= =?UTF-8?q?=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request-approve/DueDateInput.vue | 5 +++-- .../request-approve/ManagerDropdown.vue | 1 + .../request-approve/RequestApprove.vue | 20 ++++++++++++------- .../request-task/CategoryDropDown.vue | 4 ++-- src/components/request-task/ReRequestTask.vue | 2 +- src/components/request-task/RequestTask.vue | 2 +- .../request-task/RequestTaskInput.vue | 4 ++-- src/types/common.ts | 1 + 8 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/components/request-approve/DueDateInput.vue b/src/components/request-approve/DueDateInput.vue index e751396..7d21c47 100644 --- a/src/components/request-approve/DueDateInput.vue +++ b/src/components/request-approve/DueDateInput.vue @@ -2,7 +2,8 @@ @@ -12,7 +13,7 @@ import type { DueDateInputProps } from '@/types/common' import { computed, defineEmits, defineProps, onMounted } from 'vue' -const { modelValue, inputType } = defineProps() +const { modelValue, inputType, isInvalidate } = defineProps() const emit = defineEmits(['update:modelValue']) diff --git a/src/components/request-approve/ManagerDropdown.vue b/src/components/request-approve/ManagerDropdown.vue index 423a4aa..f597a96 100644 --- a/src/components/request-approve/ManagerDropdown.vue +++ b/src/components/request-approve/ManagerDropdown.vue @@ -14,6 +14,7 @@ class="relative flex">
+ :is-invalidate="isInvalidate === 'manager' ? 'manager' : ''" />

마감기한

@@ -40,10 +40,12 @@
+ inputType="date" + :is-invalidate="isInvalidate === 'date' ? 'date' : ''" /> + inputType="time" + :is-invalidate="isInvalidate === 'date' ? 'date' : ''" />
{ } const handleSubmit = async () => { - if (!category1.value || !category2.value) { - isInvalidate.value = 'category' + if (!category1.value) { + isInvalidate.value = 'category1' + return + } + if (!category2.value) { + isInvalidate.value = 'category2' return } if (!approveData.value.processor?.memberId) { diff --git a/src/components/request-task/CategoryDropDown.vue b/src/components/request-task/CategoryDropDown.vue index 180049f..c98cef1 100644 --- a/src/components/request-task/CategoryDropDown.vue +++ b/src/components/request-task/CategoryDropDown.vue @@ -17,8 +17,8 @@ ref="htmlRef" class="relative flex">

{{ modelValue?.name ?? labelName + '를 선택해주세요' }} diff --git a/src/components/request-task/ReRequestTask.vue b/src/components/request-task/ReRequestTask.vue index af78547..9d24442 100644 --- a/src/components/request-task/ReRequestTask.vue +++ b/src/components/request-task/ReRequestTask.vue @@ -18,7 +18,7 @@ v-model="title" :placeholderText="'제목을 입력해주세요'" :label-name="'제목'" - :is-invalidate="isInvalidate" /> + :is-invalidate="isInvalidate === 'input' ? 'input' : ''" /> + :is-invalidate="isInvalidate === 'input' ? 'input' : ''" /> 잘못된 형식의 아이디입니다

diff --git a/src/types/common.ts b/src/types/common.ts index c1d69ee..43586dd 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -61,6 +61,7 @@ export type Role = 'ROLE_USER' | 'ROLE_MANAGER' | 'ROLE_ADMIN' export interface DueDateInputProps { modelValue: string | null inputType: string + isInvalidate?: string } export interface FormButtonProps { From 53945dc8d659ecf6296d07dbd5ab2959dc952b96 Mon Sep 17 00:00:00 2001 From: seorang42 Date: Thu, 13 Feb 2025 11:38:24 +0900 Subject: [PATCH 4/6] =?UTF-8?q?:bug:=20[fix]=20Logo=20=ED=81=B4=EB=A6=AD?= =?UTF-8?q?=20=EC=8B=9C=20=EB=A9=94=EC=9D=B8=20=ED=8E=98=EC=9D=B4=EC=A7=80?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=8F=99=20=EA=B8=B0=EB=8A=A5=20=EB=88=84?= =?UTF-8?q?=EB=9D=BD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/top-bar/SideBar.vue | 14 +++++++++++--- src/components/top-bar/TopBar.vue | 6 +++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/components/top-bar/SideBar.vue b/src/components/top-bar/SideBar.vue index 9ea07f4..52dbf95 100644 --- a/src/components/top-bar/SideBar.vue +++ b/src/components/top-bar/SideBar.vue @@ -13,7 +13,9 @@ @click="$emit('close')" class="cursor-pointer" :name="hamburgerIcon" /> - +
diff --git a/src/components/top-bar/TopBar.vue b/src/components/top-bar/TopBar.vue index ead8413..bce125b 100644 --- a/src/components/top-bar/TopBar.vue +++ b/src/components/top-bar/TopBar.vue @@ -8,7 +8,9 @@ @click="onOpenSide"> - +
{ if (isLogined.value) { From 3212853f2b80f17cb72c26df77d0490c490fd819 Mon Sep 17 00:00:00 2001 From: seorang42 Date: Thu, 13 Feb 2025 11:58:28 +0900 Subject: [PATCH 5/6] =?UTF-8?q?:bug:=20[fix]=20=EA=B4=80=EB=A6=AC=EC=9E=90?= =?UTF-8?q?=20TopBar=EC=97=90=20=EC=95=8C=EB=A6=BC=20=EC=95=84=EC=9D=B4?= =?UTF-8?q?=EC=BD=98=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/top-bar/TopBar.vue | 1 + src/views/LoginView.vue | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/top-bar/TopBar.vue b/src/components/top-bar/TopBar.vue index bce125b..1f61320 100644 --- a/src/components/top-bar/TopBar.vue +++ b/src/components/top-bar/TopBar.vue @@ -16,6 +16,7 @@ v-if="isLogined" class="flex items-center gap-5">
diff --git a/src/views/LoginView.vue b/src/views/LoginView.vue index 0288027..b33738b 100644 --- a/src/views/LoginView.vue +++ b/src/views/LoginView.vue @@ -22,7 +22,8 @@ v-model="id" placeholder="아이디를 입력해주세요" required - class="input-box" /> + class="input-box" + autocomplete="username" />
+ class="input-box" + autocomplete="current-password" />