
--- client/resources/api/email.js
+++ client/resources/api/email.js
... | ... | @@ -1,9 +1,16 @@ |
1 | 1 |
import apiClient from "./index"; |
2 | 2 |
|
3 |
+// 이메일 인증코드 발송 |
|
4 |
+export const sendAuthEmailProc = email => { |
|
5 |
+ return apiClient.post(`/sys/email/sendEmailVerifyCode.json`, email); |
|
6 |
+} |
|
7 |
+ |
|
8 |
+// 이메일 인증코드 확인 |
|
9 |
+export const checkAuthEmailProc = email => { |
|
10 |
+ return apiClient.post(`/sys/email/checkEmailVerifyCode.json`, email); |
|
11 |
+} |
|
12 |
+ |
|
13 |
+// 2차 인증 이메일 인증코드 확인 |
|
3 | 14 |
export const check2ndAuthProc = email => { |
4 | 15 |
return apiClient.post(`/sys/email/check2ndAuthEmailVerifyCode.json`, email); |
5 | 16 |
} |
6 |
- |
|
7 |
-export const sendAuthEmailProc = email => { |
|
8 |
- return apiClient.post(`/sys/email/sendEmailVerifyCode.json`, email); |
|
9 |
-}(파일 끝에 줄바꿈 문자 없음) |
--- client/resources/api/mbrInfo.js
+++ client/resources/api/mbrInfo.js
... | ... | @@ -35,7 +35,17 @@ |
35 | 35 |
return apiClient.post(`/mbr/searchIdProc.json`, data); |
36 | 36 |
}; |
37 | 37 |
|
38 |
-// 비밀번호 초기화 (공무원용) |
|
39 |
-export const resetPswdProc = (data) => { |
|
40 |
- return apiClient.post(`/mbr/resetPswdProc.json`, data); |
|
38 |
+// 회원정보 존재 확인 |
|
39 |
+export const existMbrProc = (data) => { |
|
40 |
+ return apiClient.post(`/mbr/existMbrProc.json`, data); |
|
41 |
+}; |
|
42 |
+ |
|
43 |
+// 새 비밀번호 설정 |
|
44 |
+export const setNewPswdProc = (data) => { |
|
45 |
+ return apiClient.post(`/mbr/setNewPswdProc.json`, data); |
|
46 |
+}; |
|
47 |
+ |
|
48 |
+// 이메일 중복 검사 |
|
49 |
+export const emailCheckProc = (data) => { |
|
50 |
+ return apiClient.post(`/mbr/findByCheckEmail.json`, data); |
|
41 | 51 |
};(파일 끝에 줄바꿈 문자 없음) |
--- client/views/pages/login/Login.vue
+++ client/views/pages/login/Login.vue
... | ... | @@ -36,8 +36,8 @@ |
36 | 36 |
<!-- 아이디/비밀번호 찾기 --> |
37 | 37 |
<div class="input-group"> |
38 | 38 |
<p class="pl10 pr10 cursor" @click="moveSignUp">회원가입</p> |
39 |
- <p class="pl10 pr10 cursor" @click="moveSearchId">아이디찾기</p> |
|
40 |
- <p class="pl10 pr0 cursor" @click="moveResetPswd">비밀번호 초기화</p> |
|
39 |
+ <p class="pl10 pr10 cursor" @click="moveSearchId">아이디 찾기</p> |
|
40 |
+ <p class="pl10 pr0 cursor" @click="moveResetPswd">비밀번호 찾기</p> |
|
41 | 41 |
</div> |
42 | 42 |
|
43 | 43 |
<!-- OAuth2 소셜 로그인 --> |
--- client/views/pages/login/ResetPswd.vue
+++ client/views/pages/login/ResetPswd.vue
... | ... | @@ -1,248 +1,494 @@ |
1 | 1 |
<template> |
2 |
- <div class="login-page page"> |
|
3 |
- <div class="flex-column justify-center align-center content"> |
|
4 |
- <div class="login-wrap pd30"> |
|
5 |
- <div class="login-title text-ct mb40 user-login"> |
|
6 |
- <p v-show="tabView === 'id'">아이디 찾기</p> |
|
7 |
- <p v-show="tabView === 'pw'">비밀번호 초기화</p> |
|
8 |
- </div> |
|
9 |
- <ul class="flex align-center find-tab mb30 pd10"> |
|
10 |
- <li |
|
11 |
- v-for="(tab, idx) in tabList" |
|
12 |
- :key="idx" |
|
13 |
- @click="showTab(tab.id)" |
|
14 |
- :class="{ |
|
15 |
- 'gd-6 pd5 text-ct radius': true, |
|
16 |
- 'tab-active': tabView === tab.id, |
|
17 |
- }" |
|
18 |
- > |
|
19 |
- {{ tab.name }} |
|
20 |
- </li> |
|
21 |
- </ul> |
|
22 |
- <div class="tab-content"> |
|
23 |
- <div |
|
24 |
- class="flex-column justify-center content" |
|
25 |
- v-show="tabView === 'id'" |
|
26 |
- style="min-height: 275px" |
|
27 |
- > |
|
28 |
- <div> |
|
29 |
- <div class="input-group mb20"> |
|
30 |
- <label for="name" class="login-label">이름</label> |
|
31 |
- <input |
|
32 |
- type="text" |
|
33 |
- name="" |
|
34 |
- id="name" |
|
35 |
- class="full-input login-input" |
|
36 |
- v-model="mbrVO.mbrNm" |
|
37 |
- placeholder="이름을 입력하세요" |
|
38 |
- ref="mbrNm" |
|
39 |
- /> |
|
40 |
- </div> |
|
41 |
- <div class="input-group mb20"> |
|
42 |
- <label for="eml" class="login-label">이메일</label> |
|
43 |
- <input |
|
44 |
- type="text" |
|
45 |
- name="" |
|
46 |
- id="eml" |
|
47 |
- class="full-input login-input" |
|
48 |
- v-model="mbrVO.eml" |
|
49 |
- placeholder="이메일을 입력하세요" |
|
50 |
- @keyup.enter="fnSearchId" |
|
51 |
- ref="eml" |
|
52 |
- /> |
|
53 |
- </div> |
|
54 |
- <button |
|
55 |
- class="large-btn green-btn point-font fw-bold" |
|
56 |
- @click="fnSearchId" |
|
57 |
- > |
|
58 |
- 조회 |
|
59 |
- </button> |
|
2 |
+ <div class="content pt50 pb50"> |
|
3 |
+ <router-link :to="{ path: $filters.ctxPath('/login.page') }">←</router-link> |
|
4 |
+ <div class="content w1200"> |
|
5 |
+ <div class="page-title point-font mb30"> |
|
6 |
+ <p v-show="tabView === 'id'">아이디 찾기</p> |
|
7 |
+ <p v-show="tabView === 'pw'">비밀번호 찾기</p> |
|
60 | 8 |
</div> |
61 |
- </div> |
|
62 |
- <div |
|
63 |
- class="flex-column justify-center content" |
|
64 |
- v-show="tabView === 'pw'" |
|
65 |
- style="min-height: 275px" |
|
66 |
- > |
|
67 |
- <div> |
|
68 |
- <div class="input-group mb20"> |
|
69 |
- <label for="lgnId" class="login-label">아이디</label> |
|
70 |
- <input |
|
71 |
- type="text" |
|
72 |
- name="" |
|
73 |
- id="lgnId" |
|
74 |
- class="full-input login-input" |
|
75 |
- v-model="mbrVO.lgnId" |
|
76 |
- placeholder="아이디를 입력하세요" |
|
77 |
- ref="lgnId" |
|
78 |
- /> |
|
79 |
- </div> |
|
80 |
- <div class="input-group mb20"> |
|
81 |
- <label for="mbrNm" class="login-label">이름</label> |
|
82 |
- <input |
|
83 |
- type="text" |
|
84 |
- name="" |
|
85 |
- id="mbrNm" |
|
86 |
- class="full-input login-input" |
|
87 |
- v-model="mbrVO.mbrNm" |
|
88 |
- placeholder="이름을 입력하세요" |
|
89 |
- ref="mbrNm" |
|
90 |
- /> |
|
91 |
- </div> |
|
92 |
- <div class="input-group mb20"> |
|
93 |
- <label for="eml" class="login-label">이메일</label> |
|
94 |
- <input |
|
95 |
- type="text" |
|
96 |
- name="" |
|
97 |
- id="eml" |
|
98 |
- class="full-input login-input" |
|
99 |
- v-model="mbrVO.eml" |
|
100 |
- placeholder="이메일을 입력하세요" |
|
101 |
- @keyup.enter="fnSearchPswd" |
|
102 |
- ref="eml" |
|
103 |
- /> |
|
104 |
- </div> |
|
105 |
- <button |
|
106 |
- class="large-btn green-btn point-font fw-bold" |
|
107 |
- @click="fnSearchPswd" |
|
108 |
- > |
|
109 |
- 초기화 |
|
110 |
- </button> |
|
9 |
+ <ul class="flex align-center find-tab mb30 pd10"> |
|
10 |
+ <li v-for="(tab, idx) in tabList" :key="idx" @click="showTab(tab.id)" :class="{ |
|
11 |
+ 'gd-6 pd5 text-ct radius': true, |
|
12 |
+ 'tab-active': tabView === tab.id, |
|
13 |
+ }" :style="{ fontWeight: tabView === tab.id ? 'bold' : 'normal' }"> |
|
14 |
+ {{ tab.name }} |
|
15 |
+ </li> |
|
16 |
+ </ul> |
|
17 |
+ <div class="tab-content"> |
|
18 |
+ <div class="flex-column justify-center content" v-if="tabView === 'id' && !certYn" style="min-height: 275px"> |
|
19 |
+ <ul class="flex align-center find-tab mb30 pd10"> |
|
20 |
+ <li v-for="(tab, idx) in idTabList" :key="idx" @click="showSubTab('id', tab.id)" :class="{ |
|
21 |
+ 'gd-6 pd5 text-ct radius': true, |
|
22 |
+ 'tab-active': idTabView === tab.id, |
|
23 |
+ }" :style="{ fontWeight: idTabView === tab.id ? 'bold' : 'normal' }"> |
|
24 |
+ {{ tab.name }} |
|
25 |
+ </li> |
|
26 |
+ </ul> |
|
27 |
+ <div class="flex-column justify-center content"> |
|
28 |
+ <div> |
|
29 |
+ <div> |
|
30 |
+ <div v-show="idTabView === 'eml'" class="input-group mb20"> |
|
31 |
+ <label for="eml" class="login-label">이메일</label> |
|
32 |
+ <input type="text" name="" id="eml" class="full-input login-input" v-model="mbrVO.eml" |
|
33 |
+ placeholder="이메일을 입력하세요" ref="eml" /> |
|
34 |
+ </div> |
|
35 |
+ <div v-show="idTabView === 'tel'" class="input-group mb20"> |
|
36 |
+ <label for="name" class="login-label">이름</label> |
|
37 |
+ <input type="text" name="" id="name" class="full-input login-input" v-model="mbrVO.mbrNm" |
|
38 |
+ placeholder="이름을 입력하세요" ref="mbrNm" /> |
|
39 |
+ </div> |
|
40 |
+ <div v-show="idTabView === 'tel'" class="input-group mb20"> |
|
41 |
+ <label for="mblTelno" class="login-label">휴대폰 번호</label> |
|
42 |
+ <input type="text" name="" id="mblTelno" class="full-input login-input" v-model="mbrVO.mblTelno" |
|
43 |
+ @input="inputFormatPhone" maxlength="13" placeholder="휴대폰 번호를 입력하세요" ref="mblTelno" /> |
|
44 |
+ </div> |
|
45 |
+ </div> |
|
46 |
+ <div> |
|
47 |
+ <button class="btn sm main" @click="fnSend"> |
|
48 |
+ {{ !sendYn ? "인증코드 발송" : "인증코드 재발송" }} |
|
49 |
+ </button> |
|
50 |
+ <span v-show="sendYn">인증코드가 발송되었습니다.</span> |
|
51 |
+ </div> |
|
52 |
+ </div> |
|
53 |
+ <div v-show="sendYn"> |
|
54 |
+ <div> |
|
55 |
+ <input type="text" class="form-control md" ref="code" @input="inputCode" v-model="code" |
|
56 |
+ maxlength="6" placeholder="인증코드를 입력하세요." /> |
|
57 |
+ <!-- <span v-show="certYn">인증코드가 확인되었습니다.</span> --> |
|
58 |
+ </div> |
|
59 |
+ <div class="btn-wrap"> |
|
60 |
+ <button class="btn sm main" @click="fnCheck">인증코드 확인</button> |
|
61 |
+ </div> |
|
62 |
+ </div> |
|
63 |
+ <!-- <button v-show="certYn" class="btn sm main" @click="fnSearchPswd"> |
|
64 |
+ 다음 |
|
65 |
+ </button> --> |
|
66 |
+ </div> |
|
67 |
+ </div> |
|
68 |
+ <div class="flex-column justify-center content" v-if="tabView === 'pw' && !certYn" style="min-height: 275px"> |
|
69 |
+ <ul class="flex align-center find-tab mb30 pd10"> |
|
70 |
+ <li v-for="(tab, idx) in pwTabList" :key="idx" @click="showSubTab('pw', tab.id)" :class="{ |
|
71 |
+ 'gd-6 pd5 text-ct radius': true, |
|
72 |
+ 'tab-active': pwTabView === tab.id, |
|
73 |
+ }" :style="{ fontWeight: idTabView === tab.id ? 'bold' : 'normal' }"> |
|
74 |
+ {{ tab.name }} |
|
75 |
+ </li> |
|
76 |
+ </ul> |
|
77 |
+ <div class="flex-column justify-center content"> |
|
78 |
+ <div> |
|
79 |
+ <div> |
|
80 |
+ <div class="input-group mb20"> |
|
81 |
+ <label for="lgnId" class="login-label">아이디</label> |
|
82 |
+ <input type="text" name="" id="lgnId" class="full-input login-input" v-model="mbrVO.lgnId" |
|
83 |
+ placeholder="아이디를 입력하세요" ref="lgnId" /> |
|
84 |
+ </div> |
|
85 |
+ <div v-show="pwTabView === 'eml'" class="input-group mb20"> |
|
86 |
+ <label for="eml" class="login-label">이메일</label> |
|
87 |
+ <input type="text" name="" id="eml" class="full-input login-input" v-model="mbrVO.eml" |
|
88 |
+ placeholder="이메일을 입력하세요" ref="eml" /> |
|
89 |
+ </div> |
|
90 |
+ <div v-show="pwTabView === 'tel'" class="input-group mb20"> |
|
91 |
+ <label for="mbrNm" class="login-label">이름</label> |
|
92 |
+ <input type="text" name="" id="mbrNm" class="full-input login-input" v-model="mbrVO.mbrNm" |
|
93 |
+ placeholder="이름을 입력하세요" ref="mbrNm" /> |
|
94 |
+ </div> |
|
95 |
+ <div v-show="pwTabView === 'tel'" class="input-group mb20"> |
|
96 |
+ <label for="mblTelno" class="login-label">휴대폰 번호</label> |
|
97 |
+ <input type="text" name="" id="mblTelno" class="full-input login-input" v-model="mbrVO.mblTelno" |
|
98 |
+ @input="inputFormatPhone" maxlength="13" placeholder="휴대폰 번호를 입력하세요" ref="mblTelno" /> |
|
99 |
+ </div> |
|
100 |
+ </div> |
|
101 |
+ <div> |
|
102 |
+ <button class="btn sm main" @click="fnSend"> |
|
103 |
+ {{ !sendYn ? "인증코드 발송" : "인증코드 재발송" }} |
|
104 |
+ </button> |
|
105 |
+ <span v-show="sendYn">인증번호가 발송되었습니다.</span> |
|
106 |
+ </div> |
|
107 |
+ </div> |
|
108 |
+ <div v-show="sendYn"> |
|
109 |
+ <div> |
|
110 |
+ <input type="text" class="form-control md" ref="code" @input="inputCode" v-model="code" |
|
111 |
+ maxlength="6" placeholder="인증코드를 입력하세요." /> |
|
112 |
+ <!-- <span v-show="certYn">인증코드가 확인되었습니다.</span> --> |
|
113 |
+ </div> |
|
114 |
+ <div class="btn-wrap"> |
|
115 |
+ <button class="btn sm main" @click="fnCheck">인증코드 확인</button> |
|
116 |
+ </div> |
|
117 |
+ </div> |
|
118 |
+ <!-- <button v-show="certYn" class="btn sm main" @click="fnSearchPswd"> |
|
119 |
+ 다음 |
|
120 |
+ </button> --> |
|
121 |
+ </div> |
|
122 |
+ </div> |
|
123 |
+ <div class="flex-column justify-center content" v-if="certYn" style="min-height: 275px"> |
|
124 |
+ <div class="text-ct"> |
|
125 |
+ <p v-show="tabView === 'id'">회원님의 아이디는 <strong>{{ mbrVO.lgnId }}</strong> 입니다.</p> |
|
126 |
+ <p v-show="tabView === 'pw'">새 비밀번호를 설정해주세요.</p> |
|
127 |
+ <div v-show="tabView === 'pw'"> |
|
128 |
+ <div class="input-group mb20"> |
|
129 |
+ <label for="newPswd" class="form-control sm">새 비밀번호</label> |
|
130 |
+ <input type="password" name="" id="newPswd" class="full-input login-input" v-model="pswd.newPswd" minlength="9" |
|
131 |
+ placeholder="영문, 숫자, 특수문자 조합 9자 이상" ref="newPswd" /> |
|
132 |
+ <span :class="{'red-text': pswd.errorPwd}">영문, 숫자, 특수문자를 조합하여 입력해주세요. (9자 이상)</span> |
|
133 |
+ </div> |
|
134 |
+ <div class="input-group mb20"> |
|
135 |
+ <label for="newPswdChk" :class="{ 'form-control sm': true, 'error': pswd.pswdChk }">새 비밀번호확인</label> |
|
136 |
+ <input type="password" name="" id="newPswdChk" class="full-input login-input" v-model="pswd.newPswdChk" minlength="9" |
|
137 |
+ placeholder="비밀번호 확인을 입력하세요." ref="newPswdChk" /> |
|
138 |
+ </div> |
|
139 |
+ <button class="btn sm main" @click="fnSetPswd"> |
|
140 |
+ 완료 |
|
141 |
+ </button> |
|
142 |
+ </div> |
|
143 |
+ </div> |
|
144 |
+ </div> |
|
111 | 145 |
</div> |
112 |
- </div> |
|
113 | 146 |
</div> |
114 |
- </div> |
|
115 | 147 |
</div> |
116 |
- </div> |
|
117 | 148 |
</template> |
118 | 149 |
|
119 | 150 |
<script> |
120 | 151 |
import validateParams from "../../../resources/js/validateParams"; |
121 | 152 |
// API |
122 |
-import { searchIdProc } from "../../../resources/api/mbrInfo"; |
|
123 |
-import { resetPswdProc } from "../../../resources/api/mbrInfo"; |
|
153 |
+import { searchIdProc, existMbrProc, setNewPswdProc } from "../../../resources/api/mbrInfo"; |
|
154 |
+import { sendAuthEmailProc, checkAuthEmailProc } from "../../../resources/api/email"; |
|
124 | 155 |
|
125 | 156 |
export default { |
126 |
- mixins: [validateParams], |
|
127 |
- data: () => { |
|
128 |
- return { |
|
129 |
- tabList: [ |
|
130 |
- { id: "id", name: "아이디 찾기" }, |
|
131 |
- { id: "pw", name: "비밀번호 초기화" }, |
|
132 |
- ], |
|
133 |
- mbrVO: { |
|
134 |
- lgnId: null, |
|
135 |
- mbrNm: null, |
|
136 |
- eml: null, |
|
137 |
- }, |
|
138 |
- tabView: "id", |
|
139 |
- }; |
|
140 |
- }, |
|
141 |
- created() { |
|
142 |
- const tab = this.$route.query.tab; |
|
143 |
- if (tab) { |
|
144 |
- this.tabView = tab; |
|
157 |
+ mixins: [validateParams], |
|
158 |
+ data: () => { |
|
159 |
+ return { |
|
160 |
+ isLoading: false, // 로딩 여부 |
|
161 |
+ |
|
162 |
+ tabList: [ |
|
163 |
+ { id: "id", name: "아이디 찾기" }, |
|
164 |
+ { id: "pw", name: "비밀번호 초기화" }, |
|
165 |
+ ], |
|
166 |
+ tabView: "id", |
|
167 |
+ |
|
168 |
+ idTabList: [ |
|
169 |
+ { id: "eml", name: "이메일로 찾기" }, |
|
170 |
+ { id: "tel", name: "휴대폰번호로 찾기" }, |
|
171 |
+ ], |
|
172 |
+ idTabView: "eml", |
|
173 |
+ |
|
174 |
+ pwTabList: [ |
|
175 |
+ { id: "eml", name: "이메일로 찾기" }, |
|
176 |
+ { id: "tel", name: "휴대폰번호로 찾기" }, |
|
177 |
+ ], |
|
178 |
+ pwTabView: "eml", |
|
179 |
+ |
|
180 |
+ // 회원 정보 |
|
181 |
+ mbrVO: { |
|
182 |
+ lgnId: null, |
|
183 |
+ mbrNm: null, |
|
184 |
+ pswd: null, |
|
185 |
+ eml: null, |
|
186 |
+ mblTelno: null, |
|
187 |
+ }, |
|
188 |
+ |
|
189 |
+ sendYn: false, // 인증코드 발송 여부 |
|
190 |
+ code: null, // 인증코드 |
|
191 |
+ certYn: false, // 인증여부 |
|
192 |
+ |
|
193 |
+ // 비밀번호 정보 |
|
194 |
+ pswd: { |
|
195 |
+ newPswd: null, |
|
196 |
+ newPswdChk: null, |
|
197 |
+ errorPwd: false, // 비밀번호 유효성 검사 실패 여부 |
|
198 |
+ pswdChk: false, // 비밀번호 확인 실패 여부 |
|
199 |
+ }, |
|
200 |
+ }; |
|
201 |
+ }, |
|
202 |
+ created() { |
|
203 |
+ const tab = this.$route.query.tab; |
|
204 |
+ if (tab) { |
|
205 |
+ this.tabView = tab; |
|
206 |
+ } |
|
207 |
+ }, |
|
208 |
+ methods: { |
|
209 |
+ // 초기화 |
|
210 |
+ init() { |
|
211 |
+ // 회원 정보 초기화 |
|
212 |
+ this.mbrVO = { |
|
213 |
+ lgnId: null, |
|
214 |
+ mbrNm: null, |
|
215 |
+ pswd: null, |
|
216 |
+ eml: null, |
|
217 |
+ mblTelno: null, |
|
218 |
+ }; |
|
219 |
+ this.sendYn = false; // 인증코드 발송 여부 초기화 |
|
220 |
+ this.code = null; // 인증코드 초기화 |
|
221 |
+ this.certYn = false; // 인증여부 초기화 |
|
222 |
+ // 비밀번호 정보 초기화 |
|
223 |
+ this.pswd = { |
|
224 |
+ newPswd: null, |
|
225 |
+ newPswdChk: null, |
|
226 |
+ errorPwd: false, // 비밀번호 유효성 검사 실패 여부 |
|
227 |
+ pswdChk: false, // 비밀번호 확인 실패 여부 |
|
228 |
+ }; |
|
229 |
+ }, |
|
230 |
+ |
|
231 |
+ // 메인 탭 전환 |
|
232 |
+ showTab(content) { |
|
233 |
+ this.init(); // 초기화 |
|
234 |
+ |
|
235 |
+ this.idTabView = "eml"; |
|
236 |
+ this.pwTabView = "eml"; |
|
237 |
+ |
|
238 |
+ this.tabView = content; |
|
239 |
+ }, |
|
240 |
+ |
|
241 |
+ // 서브 탭 전환 |
|
242 |
+ showSubTab(type, content) { |
|
243 |
+ this.init(); // 초기화 |
|
244 |
+ |
|
245 |
+ if (type === 'id') { |
|
246 |
+ this.idTabView = content; |
|
247 |
+ } else if (type === 'pw') { |
|
248 |
+ this.pwTabView = content; |
|
249 |
+ } |
|
250 |
+ }, |
|
251 |
+ |
|
252 |
+ // 아이디찾기 유효성검사 |
|
253 |
+ validationId() { |
|
254 |
+ if (this.idTabView === "eml") { |
|
255 |
+ // 이메일 |
|
256 |
+ if (!this.validateEmlFull(this.mbrVO.eml)) { |
|
257 |
+ return false; |
|
258 |
+ } |
|
259 |
+ } else if (this.idTabView === "tel") { |
|
260 |
+ // 이름 |
|
261 |
+ if (!this.validateNm(this.mbrVO.mbrNm)) { |
|
262 |
+ return false; |
|
263 |
+ } |
|
264 |
+ // 휴대폰번호 |
|
265 |
+ if (!this.validateMblNo(this.mbrVO.mblTelno)) { |
|
266 |
+ return false; |
|
267 |
+ } |
|
268 |
+ } |
|
269 |
+ |
|
270 |
+ return true; |
|
271 |
+ }, |
|
272 |
+ |
|
273 |
+ // 비밀번호초기화 유효성검사 |
|
274 |
+ validationPswd() { |
|
275 |
+ // 아이디 |
|
276 |
+ if (!this.validateId(this.mbrVO.lgnId)) { |
|
277 |
+ return false; |
|
278 |
+ } |
|
279 |
+ if (this.pwTabView === "eml") { |
|
280 |
+ // 이메일 |
|
281 |
+ if (!this.validateEmlFull(this.mbrVO.eml)) { |
|
282 |
+ return false; |
|
283 |
+ } |
|
284 |
+ } else if (this.pwTabView === "tel") { |
|
285 |
+ // 이름 |
|
286 |
+ if (!this.validateNm(this.mbrVO.mbrNm)) { |
|
287 |
+ return false; |
|
288 |
+ } |
|
289 |
+ // 휴대폰번호 |
|
290 |
+ if (!this.validateMblNo(this.mbrVO.mblTelno)) { |
|
291 |
+ return false; |
|
292 |
+ } |
|
293 |
+ } |
|
294 |
+ return true; |
|
295 |
+ }, |
|
296 |
+ |
|
297 |
+ // 휴대폰 번호 입력 포맷 |
|
298 |
+ inputFormatPhone(event) { |
|
299 |
+ let input = event.target.value.replace(/[^0-9]/g, ''); |
|
300 |
+ |
|
301 |
+ if (input.length <= 3) { |
|
302 |
+ this.mbrVO.mblTelno = input; |
|
303 |
+ } else if (input.length <= 6) { |
|
304 |
+ this.mbrVO.mblTelno = input.slice(0, 3) + '-' + input.slice(3); |
|
305 |
+ } else if (input.length <= 10) { |
|
306 |
+ // 10자리는 3-3-4 |
|
307 |
+ this.mbrVO.mblTelno = input.slice(0, 3) + '-' + input.slice(3, 6) + '-' + input.slice(6); |
|
308 |
+ } else { |
|
309 |
+ // 기본은 3-4-4 |
|
310 |
+ this.mbrVO.mblTelno = input.slice(0, 3) + '-' + input.slice(3, 7) + '-' + input.slice(7, 11); |
|
311 |
+ } |
|
312 |
+ }, |
|
313 |
+ |
|
314 |
+ // 인증코드 발송 |
|
315 |
+ async fnSend() { |
|
316 |
+ // 유효성검사 |
|
317 |
+ if(this.tabView === "id") { |
|
318 |
+ if (!this.validationId()) { |
|
319 |
+ return; |
|
320 |
+ } |
|
321 |
+ } else if (this.tabView === "pw") { |
|
322 |
+ if (!this.validationPswd()) { |
|
323 |
+ return; |
|
324 |
+ } |
|
325 |
+ if (!await this.fnExistMbr()) { |
|
326 |
+ return; |
|
327 |
+ } |
|
328 |
+ } |
|
329 |
+ try { |
|
330 |
+ this.sendYn = true; // 인증코드 발송 |
|
331 |
+ const res = await sendAuthEmailProc({email: this.mbrVO.eml}); |
|
332 |
+ if (res.status == 200) { |
|
333 |
+ // alert(res.data.message); |
|
334 |
+ } |
|
335 |
+ } catch (error) { |
|
336 |
+ const errorData = error.response.data; |
|
337 |
+ if (errorData.message != null && errorData.message != "") { |
|
338 |
+ alert(error.response.data.message); |
|
339 |
+ } else { |
|
340 |
+ alert("에러가 발생했습니다.\n관리자에게 문의해주세요."); |
|
341 |
+ } |
|
342 |
+ this.sendYn = false; // 발송 실패시 인증코드 발송 여부 초기화 |
|
343 |
+ } |
|
344 |
+ }, |
|
345 |
+ |
|
346 |
+ // 인증코드 입력 |
|
347 |
+ inputCode(event) { |
|
348 |
+ const input = event.target.value.replace(/[^0-9]/g, ''); |
|
349 |
+ this.code = input; |
|
350 |
+ }, |
|
351 |
+ |
|
352 |
+ // 인증코드 확인 |
|
353 |
+ async fnCheck() { |
|
354 |
+ try { |
|
355 |
+ const res = await checkAuthEmailProc({email: this.mbrVO.eml, code: this.code}); |
|
356 |
+ if (res.status == 200) { |
|
357 |
+ this.fnSearchId(); |
|
358 |
+ } |
|
359 |
+ } catch (error) { |
|
360 |
+ const errorData = error.response.data; |
|
361 |
+ if (errorData.message != null && errorData.message != "") { |
|
362 |
+ alert(error.response.data.message); |
|
363 |
+ this.$refs.code.focus(); |
|
364 |
+ } else { |
|
365 |
+ alert("에러가 발생했습니다.\n관리자에게 문의해주세요."); |
|
366 |
+ } |
|
367 |
+ } |
|
368 |
+ }, |
|
369 |
+ |
|
370 |
+ // axios: 아이디 찾기 |
|
371 |
+ async fnSearchId() { |
|
372 |
+ // 유효성검사 |
|
373 |
+ // if (!this.validationId()) { |
|
374 |
+ // return; |
|
375 |
+ // } |
|
376 |
+ // 데이터 세팅 |
|
377 |
+ let data = this.mbrVO; |
|
378 |
+ // 실행 |
|
379 |
+ try { |
|
380 |
+ const res = await searchIdProc(data); |
|
381 |
+ if(res.status == 200) { |
|
382 |
+ this.mbrVO.lgnId = res.data.data; |
|
383 |
+ this.certYn = true; |
|
384 |
+ // let isCheck = confirm("회원님의 아이디는 " + lgnId + "입니다.\n로그인 페이지로 이동하시겠습니까?"); |
|
385 |
+ // if (isCheck) { |
|
386 |
+ // this.$router.push({ |
|
387 |
+ // path: this.$filters.ctxPath("/login.page"), |
|
388 |
+ // }); |
|
389 |
+ // } |
|
390 |
+ } |
|
391 |
+ } catch (error) { |
|
392 |
+ const errorData = error.response?.data; |
|
393 |
+ if (errorData?.message != null && errorData?.message != "") { |
|
394 |
+ // alert("입력하신 정보와 일치하는 아이디가 존재하지 않습니다."); |
|
395 |
+ alert(error.response.data.message); |
|
396 |
+ } else { |
|
397 |
+ alert("에러가 발생했습니다.\n관리자에게 문의해주세요."); |
|
398 |
+ } |
|
399 |
+ } |
|
400 |
+ }, |
|
401 |
+ |
|
402 |
+ // axios: 회원정보 존재 확인 |
|
403 |
+ async fnExistMbr() { |
|
404 |
+ // 데이터 세팅 |
|
405 |
+ let data = this.mbrVO; |
|
406 |
+ // 실행 |
|
407 |
+ let result = false; |
|
408 |
+ try { |
|
409 |
+ const res = await existMbrProc(data); |
|
410 |
+ result = res.data.data; // true or false |
|
411 |
+ } catch (error) { |
|
412 |
+ const errorData = error.response?.data; |
|
413 |
+ if (errorData?.message != null && errorData?.message != "") { |
|
414 |
+ alert("입력하신 정보와 일치하는 회원이 존재하지 않습니다."); |
|
415 |
+ } else { |
|
416 |
+ alert("에러가 발생했습니다.\n관리자에게 문의해주세요."); |
|
417 |
+ } |
|
418 |
+ } finally { |
|
419 |
+ return result; |
|
420 |
+ } |
|
421 |
+ }, |
|
422 |
+ |
|
423 |
+ // axios: 새 비밀번호 설정 |
|
424 |
+ async fnSetPswd() { |
|
425 |
+ // 유효성검사 |
|
426 |
+ if (!this.validatePswd(null, this.pswd)) { |
|
427 |
+ return false; |
|
428 |
+ } |
|
429 |
+ // 데이터 세팅 |
|
430 |
+ this.mbrVO.pswd = this.pswd.newPswd; // 새 비밀번호 설정 |
|
431 |
+ let data = this.mbrVO; |
|
432 |
+ // 실행 |
|
433 |
+ try { |
|
434 |
+ const res = await setNewPswdProc(data); |
|
435 |
+ if (res.status == 200) { |
|
436 |
+ alert("비밀번호가 변경되었습니다.\n변경된 비밀번호로 로그인해주세요."); |
|
437 |
+ this.$router.push({ |
|
438 |
+ path: this.$filters.ctxPath("/login.page"), |
|
439 |
+ }); |
|
440 |
+ } |
|
441 |
+ } catch (error) { |
|
442 |
+ const errorData = error.response?.data; |
|
443 |
+ if (errorData?.message != null && errorData?.message != "") { |
|
444 |
+ // alert("입력하신 정보와 일치하는 회원이 존재하지 않습니다."); |
|
445 |
+ alert(error.response.data.message); |
|
446 |
+ } else { |
|
447 |
+ alert("에러가 발생했습니다.\n관리자에게 문의해주세요."); |
|
448 |
+ } |
|
449 |
+ } |
|
450 |
+ }, |
|
451 |
+ |
|
452 |
+ // 비밀번호변경 검증 |
|
453 |
+ pswdCheck() { |
|
454 |
+ if (this.pswd.newPswd != null && this.pswd.newPswd != "") { |
|
455 |
+ const validate = |
|
456 |
+ /^(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[$`~!@$!%*#^?&()\-_=+])/; |
|
457 |
+ if ( |
|
458 |
+ !validate.test(this.pswd.newPswd) |
|
459 |
+ ) { |
|
460 |
+ this.pswd.errorPwd = true; |
|
461 |
+ } else if (this.pswd.newPswd != null && this.pswd.newPswd != "") { |
|
462 |
+ this.pswd.errorPwd = false; |
|
463 |
+ } |
|
464 |
+ } else { |
|
465 |
+ this.pswd.errorPwd = null; |
|
466 |
+ } |
|
467 |
+ }, |
|
468 |
+ // 비밀번호변경확인 검증 |
|
469 |
+ pswdChkCheck() { |
|
470 |
+ if (this.pswd.newPswdChk != null && this.pswd.newPswdChk != "") { |
|
471 |
+ if (this.pswd.newPswd == this.pswd.newPswdChk) { |
|
472 |
+ this.pswd.pswdChk = false; |
|
473 |
+ } else { |
|
474 |
+ this.pswd.pswdChk = true; |
|
475 |
+ } |
|
476 |
+ } else { |
|
477 |
+ this.pswd.pswdChk = null; |
|
478 |
+ } |
|
479 |
+ }, |
|
480 |
+ }, |
|
481 |
+ |
|
482 |
+ watch: { |
|
483 |
+ // 비밀번호변경 감시 |
|
484 |
+ "pswd.newPswd"() { |
|
485 |
+ this.pswdCheck(); |
|
486 |
+ this.pswdChkCheck(); |
|
487 |
+ }, |
|
488 |
+ // 비밀번호변경확인 감시 |
|
489 |
+ "pswd.newPswdChk"() { |
|
490 |
+ this.pswdChkCheck(); |
|
491 |
+ }, |
|
145 | 492 |
} |
146 |
- }, |
|
147 |
- methods: { |
|
148 |
- // tab conten 보여주기 |
|
149 |
- showTab(content) { |
|
150 |
- this.tabView = content; |
|
151 |
- }, |
|
152 |
- |
|
153 |
- // axios: 아이디 찾기 |
|
154 |
- async fnSearchId() { |
|
155 |
- // 유효성검사 |
|
156 |
- if (!this.validationId()) { |
|
157 |
- return; |
|
158 |
- } |
|
159 |
- // 데이터 세팅 |
|
160 |
- let data = this.mbrVO; |
|
161 |
- // 실행 |
|
162 |
- try { |
|
163 |
- const response = await searchIdProc(data); |
|
164 |
- let lgnId = response.data.data; |
|
165 |
- let isCheck = confirm( |
|
166 |
- "아이디 조회에 성공했습니다.\n회원님의 아이디는 " + |
|
167 |
- lgnId + |
|
168 |
- "입니다.\n로그인 페이지로 이동하시겠습니까?" |
|
169 |
- ); |
|
170 |
- if (isCheck) { |
|
171 |
- this.$router.push({ |
|
172 |
- path: this.$filters.ctxPath("/login.page"), |
|
173 |
- }); |
|
174 |
- } |
|
175 |
- } catch (error) { |
|
176 |
- alert( |
|
177 |
- "입력한 정보와 일치하는 회원이 존재하지 않습니다.\n다시 시도하세요." |
|
178 |
- ); |
|
179 |
- this.mbrVO = { |
|
180 |
- mbrNm: null, |
|
181 |
- eml: null, |
|
182 |
- }; |
|
183 |
- } |
|
184 |
- }, |
|
185 |
- |
|
186 |
- // axios: 비밀번호 찾기 |
|
187 |
- async fnSearchPswd() { |
|
188 |
- // 유효성검사 |
|
189 |
- if (!this.validationPswd()) { |
|
190 |
- return; |
|
191 |
- } |
|
192 |
- // 데이터 세팅 |
|
193 |
- let data = this.mbrVO; |
|
194 |
- // 실행 |
|
195 |
- try { |
|
196 |
- const response = await resetPswdProc(data); |
|
197 |
- if (response.status == 200) { |
|
198 |
- let isCheck = confirm( |
|
199 |
- "비밀번호 초기화에 성공했습니다.\n로그인 페이지로 이동하시겠습니까?" |
|
200 |
- ); |
|
201 |
- if (isCheck) { |
|
202 |
- this.$router.push({ |
|
203 |
- path: this.$filters.ctxPath("/login.page"), |
|
204 |
- }); |
|
205 |
- } |
|
206 |
- } |
|
207 |
- } catch (error) { |
|
208 |
- alert( |
|
209 |
- "입력한 정보와 일치하는 회원이 존재하지 않습니다.\n다시 시도하세요." |
|
210 |
- ); |
|
211 |
- this.mbrVO = { |
|
212 |
- mbrNm: null, |
|
213 |
- eml: null, |
|
214 |
- }; |
|
215 |
- } |
|
216 |
- }, |
|
217 |
- // 아이디찾기 유효성검사 |
|
218 |
- validationId() { |
|
219 |
- // 이름 |
|
220 |
- if (!this.validateNm(this.mbrVO.mbrNm)) { |
|
221 |
- return false; |
|
222 |
- } |
|
223 |
- // 이메일 |
|
224 |
- if (!this.validateEmlFull(this.mbrVO.eml)) { |
|
225 |
- return false; |
|
226 |
- } |
|
227 |
- return true; |
|
228 |
- }, |
|
229 |
- |
|
230 |
- // 비밀번호초기화 유효성검사 |
|
231 |
- validationPswd() { |
|
232 |
- // 아이디 |
|
233 |
- if (!this.validateNm(this.mbrVO.lgnId)) { |
|
234 |
- return false; |
|
235 |
- } |
|
236 |
- // 이름 |
|
237 |
- if (!this.validateNm(this.mbrVO.mbrNm)) { |
|
238 |
- return false; |
|
239 |
- } |
|
240 |
- // 이메일 |
|
241 |
- if (!this.validateEmlFull(this.mbrVO.eml)) { |
|
242 |
- return false; |
|
243 |
- } |
|
244 |
- return true; |
|
245 |
- }, |
|
246 |
- }, |
|
247 | 493 |
}; |
248 | 494 |
</script> |
--- client/views/pages/login/SignUp.vue
+++ client/views/pages/login/SignUp.vue
... | ... | @@ -1,5 +1,6 @@ |
1 | 1 |
<template> |
2 | 2 |
<div class="content pt50 pb50"> |
3 |
+ <router-link :to="{ path: $filters.ctxPath('/login.page') }">←</router-link> |
|
3 | 4 |
<div class="content w1200"> |
4 | 5 |
<div class="page-title point-font mb30"> |
5 | 6 |
<p>회원가입</p> |
... | ... | @@ -65,13 +66,13 @@ |
65 | 66 |
<div class="check-area"> |
66 | 67 |
<input type="text" class="form-control sm" ref="emailId" v-model="email.id" |
67 | 68 |
oninput="this.value = this.value.replace(/[ㄱ-ㅎ|ㅏ-ㅣ|가-힣]/g, '');" |
68 |
- placeholder="이메일을 입력하세요." /> |
|
69 |
+ placeholder="이메일을 입력하세요." :disabled="certYn"/> |
|
69 | 70 |
<div>@</div> |
70 | 71 |
<template v-if="email.select == 'self'"> |
71 | 72 |
<input type="text" class="form-control sm" ref="emailAddress" |
72 |
- v-model="email.address" /> |
|
73 |
+ v-model="email.address" :disabled="certYn"/> |
|
73 | 74 |
</template> |
74 |
- <select class="form-select sm" ref="emailSelect" v-model="email.select"> |
|
75 |
+ <select class="form-select sm" ref="emailSelect" v-model="email.select" :disabled="certYn"> |
|
75 | 76 |
<option value="">선택하세요</option> |
76 | 77 |
<option value="self">직접입력</option> |
77 | 78 |
<option value="naver.com">naver.com</option> |
... | ... | @@ -81,6 +82,22 @@ |
81 | 82 |
<option value="kakao.com">kakao.com</option> |
82 | 83 |
</select> |
83 | 84 |
</div> |
85 |
+ <div v-show="!certYn"> |
|
86 |
+ <button class="btn sm main" @click="fnSend"> |
|
87 |
+ {{ !sendYn ? "인증코드 발송" : "인증코드 재발송" }} |
|
88 |
+ </button> |
|
89 |
+ <span v-show="sendYn">인증코드가 발송되었습니다.</span> |
|
90 |
+ <div v-show="sendYn"> |
|
91 |
+ <div> |
|
92 |
+ <input type="text" class="form-control md" ref="code" @input="inputCode" v-model="code" |
|
93 |
+ maxlength="6" placeholder="인증코드를 입력하세요." /> |
|
94 |
+ </div> |
|
95 |
+ <div class="btn-wrap"> |
|
96 |
+ <button v-show="!certYn" class="btn sm main" @click="fnCheck">인증코드 확인</button> |
|
97 |
+ </div> |
|
98 |
+ </div> |
|
99 |
+ </div> |
|
100 |
+ <span v-show="certYn">인증코드가 확인되었습니다.</span> |
|
84 | 101 |
</div> |
85 | 102 |
<div v-if="showOpt.isSmsAgree" class="layout"> |
86 | 103 |
<label class="form-title"><span>*</span>문자수신</label> |
... | ... | @@ -152,7 +169,7 @@ |
152 | 169 |
// 'green-btn': pageRole == 'portal', |
153 | 170 |
}" @click="fnInsert">완료 |
154 | 171 |
</button> |
155 |
- <button class="btn sm tertiary" @click="fnCancel">취소</button> |
|
172 |
+ <!-- <button class="btn sm tertiary" @click="fnCancel">취소</button> --> |
|
156 | 173 |
</div> |
157 | 174 |
</div> |
158 | 175 |
</div> |
... | ... | @@ -165,7 +182,8 @@ |
165 | 182 |
// COMPONENETS |
166 | 183 |
import UserInfoInsert from "../../component/userInfo/UserInfoInsert.vue"; |
167 | 184 |
|
168 |
-import { mbrDetailProc, mbrInsertProc } from "../../../resources/api/mbrInfo"; |
|
185 |
+import { mbrDetailProc, mbrInsertProc, emailCheckProc } from "../../../resources/api/mbrInfo"; |
|
186 |
+import { sendAuthEmailProc, checkAuthEmailProc } from "../../../resources/api/email"; |
|
169 | 187 |
|
170 | 188 |
export default { |
171 | 189 |
mixins: [validateParams], |
... | ... | @@ -179,6 +197,9 @@ |
179 | 197 |
mbrStts: 1, // 회원상태 |
180 | 198 |
smsRcptnAgreYn: "Y", // 문자수신동의 |
181 | 199 |
emlRcptnAgreYn: "Y", // 이메일수신동의 |
200 |
+ authorList: [ |
|
201 |
+ {authrtNm: "사용자", authrtCd: "ROLE_USER"}, |
|
202 |
+ ] |
|
182 | 203 |
}, |
183 | 204 |
showOpt: { ...defaultUserInfoParams }, // 유저정보 표시 여부 객체 |
184 | 205 |
|
... | ... | @@ -193,12 +214,16 @@ |
193 | 214 |
select: "", |
194 | 215 |
address: null, |
195 | 216 |
}, |
217 |
+ |
|
218 |
+ sendYn: false, // 인증코드 발송 여부 |
|
219 |
+ code: null, // 인증코드 |
|
220 |
+ certYn: false, // 인증여부 |
|
196 | 221 |
}; |
197 | 222 |
}, |
198 | 223 |
created() { |
199 | 224 |
}, |
200 | 225 |
methods: { |
201 |
- // axios: 사용자 정보 상세 조회 |
|
226 |
+ // axios: 회원가입 |
|
202 | 227 |
async fnInsert() { |
203 | 228 |
// 유효성검사 |
204 | 229 |
if (!this.validation()) { |
... | ... | @@ -211,7 +236,8 @@ |
211 | 236 |
// 실행 |
212 | 237 |
try { |
213 | 238 |
const response = await mbrInsertProc(data); |
214 |
- alert(response.data.message); |
|
239 |
+ // alert(response.data.message); |
|
240 |
+ alert("회원가입이 완료되었습니다."); |
|
215 | 241 |
this.$router.push({ |
216 | 242 |
path: this.$filters.ctxPath("/login.page") |
217 | 243 |
}); |
... | ... | @@ -221,54 +247,6 @@ |
221 | 247 |
alert(error.response.data.message); |
222 | 248 |
} else { |
223 | 249 |
alert("에러가 발생했습니다.\n관리자에게 문의해주세요."); |
224 |
- } |
|
225 |
- } |
|
226 |
- }, |
|
227 |
- |
|
228 |
- // 표기변경 |
|
229 |
- changeFormat() { |
|
230 |
- // 휴대폰번호 포맷 |
|
231 |
- const mbl = this.mbrVO.mblTelno?.replace(/[^0-9]/g, '') || ''; |
|
232 |
- if (mbl.length === 10) { |
|
233 |
- this.mbrVO.mblTelno = mbl.replace(/(\d{3})(\d{3})(\d{4})/, '$1-$2-$3'); |
|
234 |
- } else if (mbl.length === 11) { |
|
235 |
- this.mbrVO.mblTelno = mbl.replace(/(\d{3})(\d{4})(\d{4})/, '$1-$2-$3'); |
|
236 |
- } |
|
237 |
- |
|
238 |
- // 전화번호 포맷 |
|
239 |
- const tel = this.mbrVO.telno?.replace(/[^0-9]/g, '') || ''; |
|
240 |
- if (tel.startsWith('02')) { |
|
241 |
- // 서울 지역번호 (2자리) |
|
242 |
- if (tel.length === 9) { |
|
243 |
- this.mbrVO.telno = tel.replace(/(\d{2})(\d{3})(\d{4})/, '$1-$2-$3'); |
|
244 |
- } else if (tel.length === 10) { |
|
245 |
- this.mbrVO.telno = tel.replace(/(\d{2})(\d{4})(\d{4})/, '$1-$2-$3'); |
|
246 |
- } |
|
247 |
- } else { |
|
248 |
- // 나머지 지역번호 (3자리) |
|
249 |
- if (tel.length === 10) { |
|
250 |
- this.mbrVO.telno = tel.replace(/(\d{3})(\d{3})(\d{4})/, '$1-$2-$3'); |
|
251 |
- } else if (tel.length === 11) { |
|
252 |
- this.mbrVO.telno = tel.replace(/(\d{3})(\d{4})(\d{4})/, '$1-$2-$3'); |
|
253 |
- } |
|
254 |
- } |
|
255 |
- |
|
256 |
- // 이메일 |
|
257 |
- if (this.mbrVO.eml != null) { |
|
258 |
- const email = this.mbrVO.eml.split("@"); |
|
259 |
- this.email.id = email[0]; |
|
260 |
- switch (email[1]) { |
|
261 |
- case "naver.com": |
|
262 |
- case "gmail.com": |
|
263 |
- case "hanmail.net": |
|
264 |
- case "nate.com": |
|
265 |
- case "kakao.com": |
|
266 |
- this.email.select = email[1]; |
|
267 |
- break; |
|
268 |
- default: |
|
269 |
- this.email.select = "self"; |
|
270 |
- this.email.address = email[1]; |
|
271 |
- break; |
|
272 | 250 |
} |
273 | 251 |
} |
274 | 252 |
}, |
... | ... | @@ -417,6 +395,10 @@ |
417 | 395 |
if (this.showOpt.isEml) { |
418 | 396 |
if (!this.validateEml(this.email)) { |
419 | 397 |
return false; |
398 |
+ } else if (!this.certYn) { |
|
399 |
+ alert("이메일 인증을 완료해주세요."); |
|
400 |
+ this.$refs.code.focus(); |
|
401 |
+ return false; |
|
420 | 402 |
} |
421 | 403 |
} |
422 | 404 |
// 문자수신 |
... | ... | @@ -437,23 +419,6 @@ |
437 | 419 |
return false; |
438 | 420 |
} |
439 | 421 |
} |
440 |
- |
|
441 |
- if (this.pageRole == "adm") { |
|
442 |
- if (this.showOpt.isAuthor) { |
|
443 |
- // 회원상태: 차단 |
|
444 |
- if (this.showOpt.isStts) { |
|
445 |
- if (!this.validateBlock(this.mbrVO)) { |
|
446 |
- return false; |
|
447 |
- } |
|
448 |
- } |
|
449 |
- // 사용자 권한 |
|
450 |
- // if (this.mbrVO.authorList.length < 1) { |
|
451 |
- // alert("사용자의 권한을 최소 1개 이상 추가하세요."); |
|
452 |
- // return false; |
|
453 |
- // } |
|
454 |
- } |
|
455 |
- } |
|
456 |
- |
|
457 | 422 |
return true; |
458 | 423 |
}, |
459 | 424 |
|
... | ... | @@ -466,6 +431,84 @@ |
466 | 431 |
} |
467 | 432 |
}, |
468 | 433 |
|
434 |
+ // 인증코드 발송 |
|
435 |
+ async fnSend() { |
|
436 |
+ // 이메일 유효성검사 |
|
437 |
+ if (!this.validateEml(this.email)) { |
|
438 |
+ return; |
|
439 |
+ } |
|
440 |
+ // 데이터 세팅 |
|
441 |
+ let eml = this.emailSum(); |
|
442 |
+ |
|
443 |
+ // 이메일 중복 검사 |
|
444 |
+ if(await this.fnEmailCheck(eml)) { |
|
445 |
+ return; |
|
446 |
+ } |
|
447 |
+ |
|
448 |
+ try { |
|
449 |
+ this.sendYn = true; // 인증코드 발송 |
|
450 |
+ const res = await sendAuthEmailProc({email: eml}); |
|
451 |
+ if (res.status == 200) { |
|
452 |
+ // alert(res.data.message); |
|
453 |
+ } |
|
454 |
+ } catch (error) { |
|
455 |
+ const errorData = error.response.data; |
|
456 |
+ if (errorData.message != null && errorData.message != "") { |
|
457 |
+ alert(error.response.data.message); |
|
458 |
+ } else { |
|
459 |
+ alert("에러가 발생했습니다.\n관리자에게 문의해주세요."); |
|
460 |
+ } |
|
461 |
+ this.sendYn = false; // 발송 실패시 인증코드 발송 여부 초기화 |
|
462 |
+ } |
|
463 |
+ }, |
|
464 |
+ |
|
465 |
+ // 인증코드 입력 |
|
466 |
+ inputCode(event) { |
|
467 |
+ const input = event.target.value.replace(/[^0-9]/g, ''); |
|
468 |
+ this.code = input; |
|
469 |
+ }, |
|
470 |
+ |
|
471 |
+ // 인증코드 확인 |
|
472 |
+ async fnCheck() { |
|
473 |
+ // 데이터 세팅 |
|
474 |
+ let eml = this.emailSum(); |
|
475 |
+ try { |
|
476 |
+ const res = await checkAuthEmailProc({email: eml, code: this.code}); |
|
477 |
+ if (res.status == 200) { |
|
478 |
+ this.certYn = true; // 인증 성공 |
|
479 |
+ } |
|
480 |
+ } catch (error) { |
|
481 |
+ const errorData = error.response.data; |
|
482 |
+ if (errorData.message != null && errorData.message != "") { |
|
483 |
+ alert(error.response.data.message); |
|
484 |
+ this.$refs.code.focus(); |
|
485 |
+ } else { |
|
486 |
+ alert("에러가 발생했습니다.\n관리자에게 문의해주세요."); |
|
487 |
+ } |
|
488 |
+ } |
|
489 |
+ }, |
|
490 |
+ |
|
491 |
+ // 이메일 중복 검사 |
|
492 |
+ async fnEmailCheck(eml) { |
|
493 |
+ let result = true; |
|
494 |
+ try { |
|
495 |
+ const res = await emailCheckProc({eml: eml}); |
|
496 |
+ if (res.status == 200) { |
|
497 |
+ result = false; // 중복된 이메일이 없으면 false |
|
498 |
+ } |
|
499 |
+ } catch (error) { |
|
500 |
+ const errorData = error.response.data; |
|
501 |
+ if (errorData.message != null && errorData.message != "") { |
|
502 |
+ alert(error.response.data.message); |
|
503 |
+ this.$refs.code.focus(); |
|
504 |
+ } else { |
|
505 |
+ alert("에러가 발생했습니다.\n관리자에게 문의해주세요."); |
|
506 |
+ } |
|
507 |
+ } finally { |
|
508 |
+ return result; // 중복 검사 결과 반환 |
|
509 |
+ } |
|
510 |
+ }, |
|
511 |
+ |
|
469 | 512 |
// 취소 |
470 | 513 |
fnCancel() { |
471 | 514 |
const isCheck = confirm("회원가입을 취소하시겠습니까?"); |
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?