Skip to content

Commit 893e14f

Browse files
authored
Merge pull request #138 from TaskFlow-CLAP/CLAP-352
CLAP-352 오류사항 Chloe
2 parents b64f830 + 9b84eed commit 893e14f

4 files changed

Lines changed: 39 additions & 17 deletions

File tree

src/components/common/EditInformation.vue

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<input
5353
:class="[
5454
'block w-full px-4 py-4 border rounded focus:outline-none h-11 mt-2 text-black',
55-
isInvalid ? 'border-red-1' : 'border-border-1'
55+
isInvalid || isFull ? 'border-red-1' : 'border-border-1'
5656
]"
5757
placeholder="이름을 입력해주세요"
5858
v-model="name"
@@ -64,6 +64,11 @@
6464
class="text-red-1 text-xs font-bold mt-1"
6565
>이름에는 특수문자가 포함될 수 없습니다.</span
6666
>
67+
<span
68+
v-show="isFull"
69+
class="text-red-1 text-xs font-bold mt-1"
70+
>이름은 1글자 이상, 10글자이하만 가능합니다.</span
71+
>
6772
</div>
6873
<div class="flex flex-col">
6974
<p class="text-body text-xs font-bold">아이디</p>
@@ -86,10 +91,6 @@
8691
<div>
8792
<p class="text-body text-xs font-bold">알림 수신 여부</p>
8893
<div class="flex flex-col mt-2 gap-2">
89-
<FormCheckbox
90-
v-model="agitCheck"
91-
:checkButtonName="'아지트'"
92-
:isChecked="agitCheck" />
9394
<FormCheckbox
9495
v-model="kakaoWorkCheck"
9596
:checkButtonName="'카카오워크'"
@@ -134,7 +135,6 @@ const memberStore = useMemberStore()
134135
const { info } = storeToRefs(memberStore)
135136
136137
const name = ref(info.value.name)
137-
const agitCheck = ref(info.value.notificationSettingInfo.agit)
138138
const emailCheck = ref(info.value.notificationSettingInfo.email)
139139
const kakaoWorkCheck = ref(info.value.notificationSettingInfo.kakaoWork)
140140
const imageDelete = ref(info.value.profileImageUrl == null ? true : false)
@@ -143,6 +143,7 @@ const selectedFile = ref<File | null>(null)
143143
const previewUrl = ref<string | null>(null)
144144
145145
const isInvalid = ref(false)
146+
const isFull = ref(false)
146147
const nameInput = ref<HTMLInputElement | null>(null)
147148
148149
const isModalVisible = ref(false)
@@ -151,7 +152,6 @@ const isWarnningModalVisible = ref(false)
151152
watchEffect(() => {
152153
if (info.value) {
153154
name.value = info.value.name
154-
agitCheck.value = info.value.notificationSettingInfo.agit
155155
emailCheck.value = info.value.notificationSettingInfo.email
156156
kakaoWorkCheck.value = info.value.notificationSettingInfo.kakaoWork
157157
}
@@ -160,8 +160,13 @@ watchEffect(() => {
160160
const validateName = () => {
161161
const regex = /[!@#$%^&*(),.?":{}|<>]/g
162162
isInvalid.value = regex.test(name.value)
163+
if (name.value.length > 10 || name.value.length < 1) {
164+
isFull.value = true
165+
} else {
166+
isFull.value = false
167+
}
163168
164-
if (isInvalid.value) {
169+
if (isInvalid.value || isFull.value) {
165170
nextTick(() => {
166171
nameInput.value?.focus()
167172
})
@@ -175,7 +180,6 @@ const handlePwChange = () => {
175180
if (
176181
selectedFile.value ||
177182
info.value.name != name.value ||
178-
info.value.notificationSettingInfo.agit != agitCheck.value ||
179183
info.value.notificationSettingInfo.kakaoWork != kakaoWorkCheck.value ||
180184
info.value.notificationSettingInfo.email != emailCheck.value
181185
) {
@@ -209,12 +213,11 @@ const handleFileDelete = () => {
209213
}
210214
211215
const handleSubmit = async () => {
212-
if (isInvalid.value == false) {
216+
if (isInvalid.value == false && isFull.value == false) {
213217
const formData = new FormData()
214218
const memberInfo = {
215219
name: name.value,
216220
isProfileImageDeleted: imageDelete.value,
217-
agitNotification: agitCheck.value,
218221
emailNotification: emailCheck.value,
219222
kakaoWorkNotification: kakaoWorkCheck.value
220223
}

src/components/common/ModalView.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
<div
2828
v-if="type != 'inputType'"
29-
class="flex text-sm font-bold text-body justify-center">
29+
class="flex text-sm font-bold text-body justify-center whitespace-pre-line text-center">
3030
<slot name="body"></slot>
3131
</div>
3232
</div>

src/views/LoginView.vue

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,34 @@ const handleLogin = async () => {
102102
switch (error.response?.status) {
103103
case 401:
104104
isModalVisible.value = !isModalVisible.value
105-
messageHeader.value = '일치하는 정보가 없습니다'
106-
messageBody.value = '닉네임과 비밀번호를 다시 확인해 주세요'
105+
console.log(error.response?.data)
106+
if (error.response?.data == 'AUTH_015') {
107+
messageHeader.value = '정지된 계정입니다'
108+
messageBody.value =
109+
'로그인 시도 5회 초과로 계정이 정지되었습니다\n30분 후 다시 시도해주세요'
110+
} else {
111+
messageHeader.value = '일치하는 정보가 없습니다'
112+
messageBody.value = '닉네임과 비밀번호를 다시 확인해주세요'
113+
}
114+
break
115+
116+
case 404:
117+
isModalVisible.value = !isModalVisible.value
118+
messageHeader.value = '활성화 되어있지 않은 계정입니다'
119+
messageBody.value = '접근 상태를 다시 확인하여주세요'
107120
break
108121
109122
case 500:
110123
isModalVisible.value = !isModalVisible.value
111124
messageHeader.value = '서버에 문제가 발생했습니다'
112125
messageBody.value = '잠시후 다시 이용해주세요'
113126
break
127+
128+
default:
129+
isModalVisible.value = !isModalVisible.value
130+
messageHeader.value = '문제가 발생했습니다'
131+
messageBody.value = '잠시후 다시 이용해주세요'
132+
break
114133
}
115134
}
116135
}

src/views/PwChangeView.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
:class="[
3232
'block w-full px-4 py-4 border rounded focus:outline-none',
3333
isInvalid ? 'border-red-1' : 'border-border-1'
34-
]"
35-
@blur="validatePassword" />
34+
]" />
3635
<p
3736
v-show="isInvalid"
3837
class="text-red-1 text-xs font-bold mt-1">
@@ -110,7 +109,8 @@ const closeModal = () => {
110109
}
111110
112111
const handleChange = () => {
113-
if (newPw.value === checkPw.value) {
112+
validatePassword()
113+
if (isInvalid.value == false && newPw.value === checkPw.value) {
114114
patchPassword(newPw.value)
115115
pwChange()
116116
openModal()

0 commit comments

Comments
 (0)