
--- client/views/component/userInfo/UserInfoInsert.vue
+++ client/views/component/userInfo/UserInfoInsert.vue
... | ... | @@ -64,21 +64,22 @@ |
64 | 64 |
<div v-if="showOpt.isEml" class="layout"> |
65 | 65 |
<label class="form-title"><span>*</span>이메일</label> |
66 | 66 |
<div class="check-area"> |
67 |
- <input type="text" class="form-control sm" ref="emailId" v-model="email.id" oninput="this.value = |
|
68 |
- this.value.replace(/[ㄱ-ㅎ|ㅏ-ㅣ|가-힣]/g, '');" placeholder="이메일을 입력하세요." /> |
|
67 |
+ <input type="text" class="form-control sm" ref="emailId" v-model="email.id" :disabled="mbrVO.socialAccountList.length > 0" |
|
68 |
+ oninput="this.value = this.value.replace(/[ㄱ-ㅎ|ㅏ-ㅣ|가-힣]/g, '');" placeholder="이메일을 입력하세요." /> |
|
69 | 69 |
<div>@</div> |
70 | 70 |
<template v-if="email.select == 'self'"> |
71 |
- <input type="text" class="form-control sm" ref="emailAddress" v-model="email.address" /> |
|
71 |
+ <input type="text" class="form-control sm" ref="emailAddress" v-model="email.address" :disabled="mbrVO.socialAccountList.length > 0"/> |
|
72 | 72 |
</template> |
73 |
- <select class="form-select sm" ref="emailSelect" v-model="email.select"> |
|
73 |
+ <select class="form-select sm" ref="emailSelect" v-model="email.select" :disabled="mbrVO.socialAccountList.length > 0"> |
|
74 | 74 |
<option value="">선택하세요</option> |
75 | 75 |
<option value="self">직접입력</option> |
76 | 76 |
<option value="naver.com">naver.com</option> |
77 |
- <option value="google.com">google.com</option> |
|
77 |
+ <option value="gmail.com">gmail.com</option> |
|
78 | 78 |
<option value="hanmail.net">hanmail.net</option> |
79 | 79 |
<option value="nate.com">nate.com</option> |
80 | 80 |
<option value="kakao.com">kakao.com</option> |
81 | 81 |
</select> |
82 |
+ <!-- <span v-if="mbrVO.socialAccountList.length > 1" class="red-text">활성화된 SNS 연동 계정이 존재하여 수정이 불가능합니다.</span> --> |
|
82 | 83 |
</div> |
83 | 84 |
</div> |
84 | 85 |
<div v-if="showOpt.isSmsAgree" class="layout"> |
... | ... | @@ -218,7 +219,7 @@ |
218 | 219 |
return { |
219 | 220 |
pageRole: this.$store.state.userType, // 유저 권한 |
220 | 221 |
|
221 |
- mbrVO: {}, |
|
222 |
+ mbrVO: { socialAccountList: []}, |
|
222 | 223 |
showOpt: { ...defaultUserInfoParams }, // 유저정보 표시 여부 객체 |
223 | 224 |
|
224 | 225 |
pswd: { |
... | ... | @@ -327,7 +328,7 @@ |
327 | 328 |
this.email.id = email[0]; |
328 | 329 |
switch (email[1]) { |
329 | 330 |
case "naver.com": |
330 |
- case "google.com": |
|
331 |
+ case "gmail.com": |
|
331 | 332 |
case "hanmail.net": |
332 | 333 |
case "nate.com": |
333 | 334 |
case "kakao.com": |
--- client/views/component/userInfo/UserInfoView.vue
+++ client/views/component/userInfo/UserInfoView.vue
... | ... | @@ -347,7 +347,7 @@ |
347 | 347 |
this.email.id = email[0]; |
348 | 348 |
switch (email[1]) { |
349 | 349 |
case "naver.com": |
350 |
- case "google.com": |
|
350 |
+ case "gmail.com": |
|
351 | 351 |
case "hanmail.net": |
352 | 352 |
case "nate.com": |
353 | 353 |
case "kakao.com": |
--- client/views/pages/App.vue
+++ client/views/pages/App.vue
... | ... | @@ -10,7 +10,7 @@ |
10 | 10 |
</main> |
11 | 11 |
</div> |
12 | 12 |
<div v-else v-cloak class="user-wrap relative"> |
13 |
- <UserHeader v-if="path != this.$filters.ctxPath('/login.page') && path != this.$filters.ctxPath('/cmslogin.page') && !$route.path.includes('/popup.page')"/> |
|
13 |
+ <UserHeader v-if="path != this.$filters.ctxPath('/login.page') && path != this.$filters.ctxPath('/cmslogin.page') && !$route.path.includes('/popup.page') && !$route.path.includes('/signUp.page') && !$route.path.includes('/resetPswd.page')"/> |
|
14 | 14 |
<main class="main-wrap"> |
15 | 15 |
<Breadcrumb v-if="$route.path !== this.$filters.ctxPath('/adm/main.page') && $route.path !== this.$filters.ctxPath('/main.page')" /> |
16 | 16 |
<router-view /> |
--- client/views/pages/AppRouter.js
+++ client/views/pages/AppRouter.js
... | ... | @@ -241,7 +241,7 @@ |
241 | 241 |
sessionStorage.setItem("redirect", to.fullPath); |
242 | 242 |
|
243 | 243 |
// 메인 페이지 or 로그인 페이지 |
244 |
- if (to.path === filters.ctxPath('/') || to.path.includes('/login.page') || to.path.includes('/cmslogin.page') || to.path.startsWith(filters.ctxPath('/cmmn/')) || to.path.includes('/searchId.page') || to.path.includes('/resetPswd.page')) { |
|
244 |
+ if (to.path === filters.ctxPath('/') || to.path.includes('/login.page') || to.path.includes('/cmslogin.page') || to.path.startsWith(filters.ctxPath('/cmmn/')) || to.path.includes('/signUp.page') || to.path.includes('/searchId.page') || to.path.includes('/resetPswd.page')) { |
|
245 | 245 |
let path = to.path; |
246 | 246 |
// 게시판일 경우 .page로 끝나는 경로가 있으므로 마지막 '/' 이전 경로로 설정 |
247 | 247 |
if (to.path.includes('BBS_MNG')) { |
--- client/views/pages/login/Login.vue
+++ client/views/pages/login/Login.vue
... | ... | @@ -35,6 +35,7 @@ |
35 | 35 |
<div v-if="!isAdminPage"> |
36 | 36 |
<!-- 아이디/비밀번호 찾기 --> |
37 | 37 |
<div class="input-group"> |
38 |
+ <p class="pl10 pr10 cursor" @click="moveSignUp">회원가입</p> |
|
38 | 39 |
<p class="pl10 pr10 cursor" @click="moveSearchId">아이디찾기</p> |
39 | 40 |
<p class="pl10 pr0 cursor" @click="moveResetPswd">비밀번호 초기화</p> |
40 | 41 |
</div> |
... | ... | @@ -468,6 +469,12 @@ |
468 | 469 |
return null; |
469 | 470 |
}, |
470 | 471 |
|
472 |
+ moveSignUp() { |
|
473 |
+ this.$router.push({ |
|
474 |
+ path: this.$filters.ctxPath("/signUp.page"), |
|
475 |
+ }); |
|
476 |
+ }, |
|
477 |
+ |
|
471 | 478 |
moveSearchId() { |
472 | 479 |
this.$router.push({ |
473 | 480 |
path: this.$filters.ctxPath("/resetPswd.page"), |
+++ client/views/pages/login/SignUp.vue
... | ... | @@ -0,0 +1,533 @@ |
1 | +<template> | |
2 | + <div class="content pt50 pb50"> | |
3 | + <div class="content w1200"> | |
4 | + <div class="page-title point-font mb30"> | |
5 | + <p>회원가입</p> | |
6 | + </div> | |
7 | + | |
8 | + <div class="content-zone sch-full"> | |
9 | + <div class="content"> | |
10 | + <div class="scroll"> | |
11 | + <div class="form-box"> | |
12 | + <div class="form-box-title"> | |
13 | + <p>기본정보</p> | |
14 | + <p><span>*</span>필수입력</p> | |
15 | + </div> | |
16 | + <div class="form-content"> | |
17 | + <div class="layout"> | |
18 | + <label class="form-title"><span>*</span>아이디</label> | |
19 | + <input type="text" class="form-control sm" v-model="mbrVO.lgnId" ref="mbrId" | |
20 | + minlength="5" maxlength="50" placeholder="아이디를 입력하세요." | |
21 | + :disabled="mbrVO.mbrId != null" /> | |
22 | + </div> | |
23 | + <div class="layout"> | |
24 | + <label class="form-title"><span>*</span>이름</label> | |
25 | + <input type="text" class="form-control sm" ref="mbrNm" v-model="mbrVO.mbrNm" | |
26 | + minlength="2" maxlength="50" placeholder="이름을 입력하세요." /> | |
27 | + </div> | |
28 | + <div class="layout"> | |
29 | + <label class="form-title"> | |
30 | + <p><span>*</span>비밀번호</p> | |
31 | + </label> | |
32 | + <div class="form-group"> | |
33 | + <input type="password" class="form-control sm" ref="newPswd" | |
34 | + v-model="pswd.newPswd" minlength="9" placeholder="영문, 숫자, 특수문자 조합 9자 이상" /> | |
35 | + <span :class="{ | |
36 | + 'red-text': pswd.errorPwd, | |
37 | + }"> | |
38 | + 영문, 숫자, 특수문자를 조합하여 입력해주세요. (9자 이상) | |
39 | + </span> | |
40 | + </div> | |
41 | + </div> | |
42 | + <div class="layout"> | |
43 | + <label class="form-title"> | |
44 | + <p><span>*</span>비밀번호확인</p> | |
45 | + </label> | |
46 | + <input type="password" :class="{ 'form-control sm': true, 'error': pswd.pswdChk }" | |
47 | + ref="newPswdChk" v-model="pswd.newPswdChk" minlength="9" | |
48 | + placeholder="비밀번호 확인을 입력하세요." /> | |
49 | + </div> | |
50 | + <!-- <template v-if="showOpt.isMblNo || showOpt.isTelNo"> --> | |
51 | + <div v-if="showOpt.isMblNo" class="layout"> | |
52 | + <label class="form-title"><span>*</span>휴대폰번호</label> | |
53 | + <input type="text" class="form-control sm" ref="mblTelno" v-model="mbrVO.mblTelno" | |
54 | + @input="inputFormatPhone" maxlength="13" placeholder="휴대폰번호를 입력하세요." /> | |
55 | + </div> | |
56 | + <!-- </template> --> | |
57 | + <div v-if="showOpt.isTelNo" class="layout"> | |
58 | + <label class="form-title">전화번호</label> | |
59 | + <input type="text" class="form-control sm" ref="telno" v-model="mbrVO.telno" | |
60 | + @input="inputFormatTel" maxlength="13" placeholder="전화번호를 입력해주세요." /> | |
61 | + </div> | |
62 | + <!-- <template v-if="showOpt.isEml || showOpt.isSmsAgree || showOpt.isEmlAgree"> --> | |
63 | + <div v-if="showOpt.isEml" class="layout"> | |
64 | + <label class="form-title"><span>*</span>이메일</label> | |
65 | + <div class="check-area"> | |
66 | + <input type="text" class="form-control sm" ref="emailId" v-model="email.id" | |
67 | + oninput="this.value = this.value.replace(/[ㄱ-ㅎ|ㅏ-ㅣ|가-힣]/g, '');" | |
68 | + placeholder="이메일을 입력하세요." /> | |
69 | + <div>@</div> | |
70 | + <template v-if="email.select == 'self'"> | |
71 | + <input type="text" class="form-control sm" ref="emailAddress" | |
72 | + v-model="email.address" /> | |
73 | + </template> | |
74 | + <select class="form-select sm" ref="emailSelect" v-model="email.select"> | |
75 | + <option value="">선택하세요</option> | |
76 | + <option value="self">직접입력</option> | |
77 | + <option value="naver.com">naver.com</option> | |
78 | + <option value="gmail.com">gmail.com</option> | |
79 | + <option value="hanmail.net">hanmail.net</option> | |
80 | + <option value="nate.com">nate.com</option> | |
81 | + <option value="kakao.com">kakao.com</option> | |
82 | + </select> | |
83 | + </div> | |
84 | + </div> | |
85 | + <div v-if="showOpt.isSmsAgree" class="layout"> | |
86 | + <label class="form-title"><span>*</span>문자수신</label> | |
87 | + <div class="check-area"> | |
88 | + <div class="form-check"> | |
89 | + <input type="radio" name="smsRcptnAgreYn" id="smsY" class="mr5" | |
90 | + v-model="mbrVO.smsRcptnAgreYn" value="Y" /> | |
91 | + <label for="smsY">수신</label> | |
92 | + </div> | |
93 | + <div class="form-check"> | |
94 | + <input type="radio" name="smsRcptnAgreYn" id="smsN" class="mr5" | |
95 | + v-model="mbrVO.smsRcptnAgreYn" value="N" /> | |
96 | + <label for="smsN">미수신</label> | |
97 | + </div> | |
98 | + </div> | |
99 | + </div> | |
100 | + <div v-if="showOpt.isEmlAgree" class="layout"> | |
101 | + <label class="form-title"><span>*</span>이메일수신</label> | |
102 | + <div class="check-area"> | |
103 | + <div class="form-check"> | |
104 | + <input type="radio" name="emlRcptnAgreYn" id="y" class="mr5" | |
105 | + v-model="mbrVO.emlRcptnAgreYn" value="Y" /> | |
106 | + <label for="y">수신</label> | |
107 | + </div> | |
108 | + <div class="form-check"> | |
109 | + <input type="radio" name="emlRcptnAgreYn" id="n" class="mr5" | |
110 | + v-model="mbrVO.emlRcptnAgreYn" value="N" /> | |
111 | + <label for="n">미수신</label> | |
112 | + </div> | |
113 | + </div> | |
114 | + </div> | |
115 | + <!-- </template> --> | |
116 | + <template v-if="showOpt.isAddr"> | |
117 | + <div class="layout"> | |
118 | + <label class="form-title"><span>*</span>우편번호</label> | |
119 | + <input type="text" class="form-control sm" v-model="mbrVO.zip" readonly /> | |
120 | + | |
121 | + <button :class="{ | |
122 | + 'large-btn': true, | |
123 | + 'blue-border-btn': pageRole == 'adm', | |
124 | + 'green-border-btn': pageRole == 'portal', | |
125 | + }" @click="fnZipSearch"> | |
126 | + 찾기 | |
127 | + </button> | |
128 | + </div> | |
129 | + <div class="layout"> | |
130 | + <label class="form-title"><span>*</span>주소</label> | |
131 | + <input type="text" class="form-control sm" v-model="mbrVO.addr" readonly /> | |
132 | + </div> | |
133 | + <div class="layout"> | |
134 | + <label class="form-title"> | |
135 | + 상세주소 | |
136 | + </label> | |
137 | + <input type="text" class="form-control sm" ref="daddr" v-model="mbrVO.daddr" | |
138 | + placeholder="상세주소를 입력해주세요." /> | |
139 | + </div> | |
140 | + </template> | |
141 | + </div> | |
142 | + </div> | |
143 | + </div> | |
144 | + </div> | |
145 | + </div> | |
146 | + | |
147 | + | |
148 | + <div class="btn-wrap"> | |
149 | + <button :class="{ | |
150 | + 'btn sm main': true, | |
151 | + // 'blue-btn': pageRole == 'adm', | |
152 | + // 'green-btn': pageRole == 'portal', | |
153 | + }" @click="fnInsert">등록 | |
154 | + </button> | |
155 | + <button class="btn sm tertiary" @click="fnCancel">취소</button> | |
156 | + </div> | |
157 | + </div> | |
158 | + </div> | |
159 | +</template> | |
160 | + | |
161 | +<script> | |
162 | +import { defaultUserInfoParams } from "../../../resources/js/defaultUserInfoParams"; | |
163 | +import validateParams from "../../../resources/js/validateParams"; | |
164 | +// import pageAuthMixin from "../../../views/common/pageAuthMixin.js"; | |
165 | +// COMPONENETS | |
166 | +import UserInfoInsert from "../../component/userInfo/UserInfoInsert.vue"; | |
167 | + | |
168 | +import { mbrDetailProc, mbrInsertProc } from "../../../resources/api/mbrInfo"; | |
169 | + | |
170 | +export default { | |
171 | + mixins: [validateParams], | |
172 | + components: { | |
173 | + UserInfoInsert, | |
174 | + }, | |
175 | + data() { | |
176 | + return { | |
177 | + pageId: this.$store.state.mbrId, // 페이지 아이디 | |
178 | + mbrVO: { | |
179 | + mbrStts: 1, // 회원상태 | |
180 | + smsRcptnAgreYn: "Y", // 문자수신동의 | |
181 | + emlRcptnAgreYn: "Y", // 이메일수신동의 | |
182 | + }, | |
183 | + showOpt: { ...defaultUserInfoParams }, // 유저정보 표시 여부 객체 | |
184 | + | |
185 | + pswd: { | |
186 | + newPswd: null, | |
187 | + newPswdChk: null, | |
188 | + errorPwd: null, | |
189 | + pswdChk: null, | |
190 | + }, | |
191 | + email: { | |
192 | + id: null, | |
193 | + select: "", | |
194 | + address: null, | |
195 | + }, | |
196 | + }; | |
197 | + }, | |
198 | + created() { | |
199 | + this.fnMbrViewDetail(); | |
200 | + }, | |
201 | + methods: { | |
202 | + // axios: 사용자 정보 상세 조회 | |
203 | + async fnMbrViewDetail() { | |
204 | + console.log("fnMbrViewDetail: ", this.pageId); | |
205 | + // 데이터 세팅 | |
206 | + const data = { mbrId: this.pageId }; | |
207 | + // 실행 | |
208 | + try { | |
209 | + const response = await mbrDetailProc(data); | |
210 | + this.mbrVO = response.data.data; | |
211 | + console.log("mbrVO: ", this.mbrVO); | |
212 | + } catch (error) { | |
213 | + const errorData = error.response.data; | |
214 | + if (errorData.message != null && errorData.message != "") { | |
215 | + alert(error.response.data.message); | |
216 | + } else { | |
217 | + alert("에러가 발생했습니다.\n관리자에게 문의해주세요."); | |
218 | + } | |
219 | + } | |
220 | + }, | |
221 | + | |
222 | + // axios: 사용자 정보 상세 조회 | |
223 | + async fnInsert() { | |
224 | + // 유효성검사 | |
225 | + if (!this.validation()) { | |
226 | + return; | |
227 | + } | |
228 | + | |
229 | + // 데이터 세팅 | |
230 | + let data = this.mbrVO; | |
231 | + this.fnDataSetting(data); | |
232 | + // 실행 | |
233 | + try { | |
234 | + const response = await mbrInsertProc(data); | |
235 | + alert(response.data.message); | |
236 | + this.$router.push({ | |
237 | + path: this.$filters.ctxPath("/"), | |
238 | + query: { | |
239 | + pageId: | |
240 | + this.pageId == null ? response.data.data.mbrId : this.pageId, | |
241 | + }, | |
242 | + }); | |
243 | + } catch (error) { | |
244 | + const errorData = error.response.data; | |
245 | + if (errorData.message != null && errorData.message != "") { | |
246 | + alert(error.response.data.message); | |
247 | + } else { | |
248 | + alert("에러가 발생했습니다.\n관리자에게 문의해주세요."); | |
249 | + } | |
250 | + } | |
251 | + }, | |
252 | + | |
253 | + // 표기변경 | |
254 | + changeFormat() { | |
255 | + // 휴대폰번호 포맷 | |
256 | + const mbl = this.mbrVO.mblTelno?.replace(/[^0-9]/g, '') || ''; | |
257 | + if (mbl.length === 10) { | |
258 | + this.mbrVO.mblTelno = mbl.replace(/(\d{3})(\d{3})(\d{4})/, '$1-$2-$3'); | |
259 | + } else if (mbl.length === 11) { | |
260 | + this.mbrVO.mblTelno = mbl.replace(/(\d{3})(\d{4})(\d{4})/, '$1-$2-$3'); | |
261 | + } | |
262 | + | |
263 | + // 전화번호 포맷 | |
264 | + const tel = this.mbrVO.telno?.replace(/[^0-9]/g, '') || ''; | |
265 | + if (tel.startsWith('02')) { | |
266 | + // 서울 지역번호 (2자리) | |
267 | + if (tel.length === 9) { | |
268 | + this.mbrVO.telno = tel.replace(/(\d{2})(\d{3})(\d{4})/, '$1-$2-$3'); | |
269 | + } else if (tel.length === 10) { | |
270 | + this.mbrVO.telno = tel.replace(/(\d{2})(\d{4})(\d{4})/, '$1-$2-$3'); | |
271 | + } | |
272 | + } else { | |
273 | + // 나머지 지역번호 (3자리) | |
274 | + if (tel.length === 10) { | |
275 | + this.mbrVO.telno = tel.replace(/(\d{3})(\d{3})(\d{4})/, '$1-$2-$3'); | |
276 | + } else if (tel.length === 11) { | |
277 | + this.mbrVO.telno = tel.replace(/(\d{3})(\d{4})(\d{4})/, '$1-$2-$3'); | |
278 | + } | |
279 | + } | |
280 | + | |
281 | + // 이메일 | |
282 | + if (this.mbrVO.eml != null) { | |
283 | + const email = this.mbrVO.eml.split("@"); | |
284 | + this.email.id = email[0]; | |
285 | + switch (email[1]) { | |
286 | + case "naver.com": | |
287 | + case "gmail.com": | |
288 | + case "hanmail.net": | |
289 | + case "nate.com": | |
290 | + case "kakao.com": | |
291 | + this.email.select = email[1]; | |
292 | + break; | |
293 | + default: | |
294 | + this.email.select = "self"; | |
295 | + this.email.address = email[1]; | |
296 | + break; | |
297 | + } | |
298 | + } | |
299 | + }, | |
300 | + | |
301 | + // 휴대폰 번호 입력 포맷 | |
302 | + inputFormatPhone(event) { | |
303 | + let input = event.target.value.replace(/[^0-9]/g, ''); | |
304 | + | |
305 | + if (input.length <= 3) { | |
306 | + this.mbrVO.mblTelno = input; | |
307 | + } else if (input.length <= 6) { | |
308 | + this.mbrVO.mblTelno = input.slice(0, 3) + '-' + input.slice(3); | |
309 | + } else if (input.length === 10) { | |
310 | + // 10자리는 3-3-4 | |
311 | + this.mbrVO.mblTelno = input.slice(0, 3) + '-' + input.slice(3, 6) + '-' + input.slice(6); | |
312 | + } else { | |
313 | + // 기본은 3-4-4 | |
314 | + this.mbrVO.mblTelno = input.slice(0, 3) + '-' + input.slice(3, 7) + '-' + input.slice(7, 11); | |
315 | + } | |
316 | + }, | |
317 | + | |
318 | + // 전화번호 입력 포맷 | |
319 | + inputFormatTel(event) { | |
320 | + let input = event.target.value.replace(/[^0-9]/g, ''); | |
321 | + | |
322 | + if (input.startsWith('02')) { | |
323 | + // 서울 지역번호 (2자리) | |
324 | + if (input.length <= 2) { | |
325 | + this.mbrVO.telno = input; | |
326 | + } else if (input.length <= 5) { | |
327 | + this.mbrVO.telno = input.slice(0, 2) + '-' + input.slice(2); | |
328 | + } else if (input.length <= 9) { | |
329 | + this.mbrVO.telno = input.slice(0, 2) + '-' + input.slice(2, 5) + '-' + input.slice(5); | |
330 | + } else { | |
331 | + this.mbrVO.telno = input.slice(0, 2) + '-' + input.slice(2, 6) + '-' + input.slice(6, 10); | |
332 | + } | |
333 | + } else { | |
334 | + // 나머지 지역번호 (3자리) | |
335 | + if (input.length <= 3) { | |
336 | + this.mbrVO.telno = input; | |
337 | + } else if (input.length <= 6) { | |
338 | + this.mbrVO.telno = input.slice(0, 3) + '-' + input.slice(3); | |
339 | + } else if (input.length <= 10) { | |
340 | + this.mbrVO.telno = input.slice(0, 3) + '-' + input.slice(3, 6) + '-' + input.slice(6); | |
341 | + } else { | |
342 | + this.mbrVO.telno = input.slice(0, 3) + '-' + input.slice(3, 7) + '-' + input.slice(7, 11); | |
343 | + } | |
344 | + } | |
345 | + }, | |
346 | + | |
347 | + // 비밀번호변경 검증 | |
348 | + pswdCheck() { | |
349 | + if (this.pswd.newPswd != null && this.pswd.newPswd != "") { | |
350 | + const validate = | |
351 | + /^(?=.*[a-zA-Z])(?=.*[0-9])(?=.*[$`~!@$!%*#^?&()\-_=+])/; | |
352 | + if ( | |
353 | + !validate.test(this.pswd.newPswd) | |
354 | + ) { | |
355 | + this.pswd.errorPwd = true; | |
356 | + } else if (this.pswd.newPswd != null && this.pswd.newPswd != "") { | |
357 | + this.pswd.errorPwd = false; | |
358 | + } | |
359 | + } else { | |
360 | + this.pswd.errorPwd = null; | |
361 | + } | |
362 | + }, | |
363 | + // 비밀번호변경확인 검증 | |
364 | + pswdChkCheck() { | |
365 | + if (this.pswd.newPswdChk != null && this.pswd.newPswdChk != "") { | |
366 | + if (this.pswd.newPswd == this.pswd.newPswdChk) { | |
367 | + this.pswd.pswdChk = false; | |
368 | + } else { | |
369 | + this.pswd.pswdChk = true; | |
370 | + } | |
371 | + } else { | |
372 | + this.pswd.pswdChk = null; | |
373 | + } | |
374 | + }, | |
375 | + | |
376 | + // 우편번호 찾기 버튼 | |
377 | + fnZipSearch() { | |
378 | + let width = 500; //팝업의 너비 | |
379 | + let height = 600; //팝업의 높이 | |
380 | + new window.daum.Postcode({ | |
381 | + oncomplete: (data) => { | |
382 | + width: width; | |
383 | + height: height; | |
384 | + this.mbrVO.zip = data.zonecode; | |
385 | + this.mbrVO.addr = data.roadAddress; | |
386 | + }, | |
387 | + }).open({ | |
388 | + left: window.screen.width / 2 - width / 2, | |
389 | + top: window.screen.height / 2 - height / 2, | |
390 | + }); | |
391 | + }, | |
392 | + | |
393 | + // 데이터 세팅 | |
394 | + fnDataSetting(data) { | |
395 | + // 비밀번호 | |
396 | + if (this.pswd.newPswd != null && this.pswd.newPswd != "") { | |
397 | + data.pswd = this.pswd.newPswd.replace(/(\s*)/g, ""); | |
398 | + } else { | |
399 | + data.pswd = null; | |
400 | + } | |
401 | + | |
402 | + // 휴대폰 번호 | |
403 | + data.mblTelno = this.mbrVO.mblTelno.replace(/-/g, ''); // 하이픈 제거 | |
404 | + | |
405 | + // 전화 번호 | |
406 | + if (this.mbrVO.telno != null) { | |
407 | + data.telno = this.mbrVO.telno.replace(/-/g, ""); | |
408 | + } | |
409 | + | |
410 | + // 이메일 | |
411 | + data.eml = this.emailSum(); | |
412 | + | |
413 | + // 회원 상태가 차단이 아니면 차단일, 차단 사유 삭제 | |
414 | + if (data.mbrStts != 3) { | |
415 | + data.cntrlDt = null; | |
416 | + data.cntrlRsn = null; | |
417 | + } | |
418 | + }, | |
419 | + | |
420 | + // 유효성검사 | |
421 | + validation() { | |
422 | + // 아이디 | |
423 | + if (!this.validateId(this.mbrVO.lgnId)) { | |
424 | + return false; | |
425 | + } | |
426 | + // 이름 | |
427 | + if (!this.validateNm(this.mbrVO.mbrNm)) { | |
428 | + return false; | |
429 | + } | |
430 | + // 비밀번호 | |
431 | + if (!this.validatePswd(this.pageId, this.pswd)) { | |
432 | + return false; | |
433 | + } | |
434 | + | |
435 | + // 휴대폰번호 | |
436 | + if (this.showOpt.isMblNo) { | |
437 | + if (!this.validateMblNo(this.mbrVO.mblTelno)) { | |
438 | + return false; | |
439 | + } | |
440 | + } | |
441 | + // 이메일 | |
442 | + if (this.showOpt.isEml) { | |
443 | + if (!this.validateEml(this.email)) { | |
444 | + return false; | |
445 | + } | |
446 | + } | |
447 | + // 문자수신 | |
448 | + if (this.showOpt.isSmsAgree) { | |
449 | + if (!this.validateSmsAgre(this.mbrVO.smsRcptnAgreYn)) { | |
450 | + return false; | |
451 | + } | |
452 | + } | |
453 | + // 이메일수신 | |
454 | + if (this.showOpt.isEmlAgree) { | |
455 | + if (!this.validateEmlAgre(this.mbrVO.emlRcptnAgreYn)) { | |
456 | + return false; | |
457 | + } | |
458 | + } | |
459 | + // 주소 | |
460 | + if (this.showOpt.isAddr) { | |
461 | + if (!this.validateAddr(this.mbrVO)) { | |
462 | + return false; | |
463 | + } | |
464 | + } | |
465 | + | |
466 | + if (this.pageRole == "adm") { | |
467 | + if (this.showOpt.isAuthor) { | |
468 | + // 회원상태: 차단 | |
469 | + if (this.showOpt.isStts) { | |
470 | + if (!this.validateBlock(this.mbrVO)) { | |
471 | + return false; | |
472 | + } | |
473 | + } | |
474 | + // 사용자 권한 | |
475 | + // if (this.mbrVO.authorList.length < 1) { | |
476 | + // alert("사용자의 권한을 최소 1개 이상 추가하세요."); | |
477 | + // return false; | |
478 | + // } | |
479 | + } | |
480 | + } | |
481 | + | |
482 | + return true; | |
483 | + }, | |
484 | + | |
485 | + // 이메일 합체 | |
486 | + emailSum() { | |
487 | + if (this.email.select != "self") { | |
488 | + return this.email.id + "@" + this.email.select; | |
489 | + } else { | |
490 | + return this.email.id + "@" + this.email.address; | |
491 | + } | |
492 | + }, | |
493 | + | |
494 | + // 취소 | |
495 | + fnCancel() { | |
496 | + const isCheck = confirm("작성을 취소하시겠습니까?"); | |
497 | + if (isCheck) { | |
498 | + if (this.pageRole != "adm") { | |
499 | + this.$router.push({ | |
500 | + path: this.routerPaths.view, | |
501 | + }); | |
502 | + } else { | |
503 | + this.$router.push({ | |
504 | + path: this.routerPaths.list, | |
505 | + }); | |
506 | + } | |
507 | + } | |
508 | + }, | |
509 | + }, | |
510 | + | |
511 | + watch: { | |
512 | + // 비밀번호변경 감시 | |
513 | + "pswd.newPswd"() { | |
514 | + this.pswdCheck(); | |
515 | + this.pswdChkCheck(); | |
516 | + }, | |
517 | + // 비밀번호변경확인 감시 | |
518 | + "pswd.newPswdChk"() { | |
519 | + this.pswdChkCheck(); | |
520 | + }, | |
521 | + // 회원상태 감시 | |
522 | + "mbrVO.mbrStts"() { | |
523 | + if (this.mbrVO.mbrStts == 3) { | |
524 | + this.mbrVO.cntrlDt = new Date().toISOString().substring(0, 10); | |
525 | + this.$refs.cntrlRsn.focus(); | |
526 | + } else { | |
527 | + this.mbrVO.cntrlDt = null; | |
528 | + this.mbrVO.cntrlRsn = null; | |
529 | + } | |
530 | + }, | |
531 | + }, | |
532 | +}; | |
533 | +</script> |
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?