|
|
@@ -153,7 +153,7 @@
|
|
|
<div class="form_field mt40">
|
|
|
<label class="input_label sr-only">신규 비밀번호</label>
|
|
|
<div class="ui_col_12">
|
|
|
- <input type="password" id="password" name="password" placeholder="신규 비밀번호" >
|
|
|
+ <input type="password" id="passwd" name="passwd" placeholder="신규 비밀번호" minlength="8" maxlength="20"/>
|
|
|
<!-- case (사용불가 비밀번호일경우,사용가능한 비밀번호일경우) -->
|
|
|
<div class="help_block">
|
|
|
<!-- 사용불가 비밀번호일경우 -->
|
|
|
@@ -170,9 +170,9 @@
|
|
|
</p>
|
|
|
<!-- //사용불가 비밀번호일경우 -->
|
|
|
<!-- 사용가능한 비밀번호일경우 -->
|
|
|
- <p class="mt10 hide">
|
|
|
- <span id="avlPwd" class="c_black2">
|
|
|
- <i class="ico ico_check black mr5"></i>사용 가능한 비밀번호입니다
|
|
|
+ <p id="avlPwd" class="mt10 hide">
|
|
|
+ <span class="c_black2">
|
|
|
+ <i class="ico ico_check black mr5"></i>사용 가능한 비밀번호입니다.
|
|
|
</span>
|
|
|
</p>
|
|
|
<!-- //사용가능한 비밀번호일경우 -->
|
|
|
@@ -183,7 +183,7 @@
|
|
|
<div class="form_field">
|
|
|
<label class="input_label sr-only">비밀번호 확인</label>
|
|
|
<div class="ui_col_12">
|
|
|
- <input type="password" id="confirmPassword" name="confirmPassword" placeholder="비밀번호 확인">
|
|
|
+ <input type="password" id="confirmPassword" name="confirmPassword" placeholder="비밀번호 확인" minlength="8" maxlength="20"/>
|
|
|
<!-- case (비밀번호확인 틀렸을경우,비밀번호 일치할경우) -->
|
|
|
<div class="help_block">
|
|
|
<!-- 비밀번호확인 틀렸을경우 -->
|
|
|
@@ -204,7 +204,7 @@
|
|
|
</div>
|
|
|
<div class="btn_group_block btn_group_md ui_row">
|
|
|
<div class="ui_col_12">
|
|
|
- <button type="button" id="btnSavePassword" class="btn btn_dark btn_block">
|
|
|
+ <button type="button" id="btnSavePassword" class="btn btn_dark btn_block" disabled="disabled">
|
|
|
<span>변경 후 다시 로그인</span>
|
|
|
</button>
|
|
|
</div>
|
|
|
@@ -370,123 +370,29 @@
|
|
|
};
|
|
|
|
|
|
// 패스워드 입력
|
|
|
- $("#resetPasswordForm input[name=password]").on('focus focusout keyup keydown', function () {
|
|
|
- let password = $(this).val();
|
|
|
- fnCheckPassword(password)
|
|
|
+ $('#resetPasswordForm input[name=passwd]').on('focus focusout keyup keydown', function () {
|
|
|
+ fnCheckPassword('#resetPasswordForm');
|
|
|
});
|
|
|
|
|
|
+ // 패스워드 확인 입력
|
|
|
+ $('#resetPasswordForm input[name=confirmPassword]').on('focus focusout keyup keydown', function () {
|
|
|
+ fnConfirmPassword('#resetPasswordForm');
|
|
|
+ });
|
|
|
|
|
|
- var fnCheckPassword = function (password) {
|
|
|
- let custId = $('#resetPasswordForm input[name=custId]').val();
|
|
|
- let $firstFailed = $('#firstFailed');
|
|
|
- let $secondFailed = $('#secondFailed');
|
|
|
- let $thirdFailed = $('#thirdFailed');
|
|
|
- let $avlPwd = $('#avlPwd');
|
|
|
- let pwdCheck = true;
|
|
|
-
|
|
|
- // 길이
|
|
|
- if(!/^[a-zA-Z0-9!@#$%^&*()?_~]{8,20}$/.test(password)) {
|
|
|
- $firstFailed.show();
|
|
|
- pwdCheck = false;
|
|
|
- } else {
|
|
|
- $firstFailed.hide();
|
|
|
- pwdCheck = true;
|
|
|
- }
|
|
|
-
|
|
|
- // 영문, 숫자, 특수문자 2종 이상 혼용
|
|
|
- let count = 0;
|
|
|
- if(password.search(/[0-9]/g) != -1 ) count ++;
|
|
|
- if(password.search(/[a-zA-Z]/ig) != -1 ) count ++;
|
|
|
- if(password.search(/[!@#$%^&*()?_~]/g) != -1 ) count ++;
|
|
|
- if(count < 2) {
|
|
|
- $firstFailed.show();
|
|
|
- pwdCheck = false;
|
|
|
- } else {
|
|
|
- $firstFailed.hide();
|
|
|
- pwdCheck = true;
|
|
|
- }
|
|
|
-
|
|
|
- // 동일한 문자/숫자 4이상, 연속된 문자
|
|
|
- if(/(\w)\1\1\1/.test(password) || isContinuedValue(password)) {
|
|
|
- $secondFailed.show();
|
|
|
- pwdCheck = false;
|
|
|
- } else {
|
|
|
- $secondFailed.hide();
|
|
|
- pwdCheck = true;
|
|
|
- }
|
|
|
-
|
|
|
- // 아이디 포함 여부
|
|
|
- if(password.search(custId)>-1) {
|
|
|
- $thirdFailed.show();
|
|
|
- pwdCheck = false;
|
|
|
- } else {
|
|
|
- $thirdFailed.hide();
|
|
|
- pwdCheck = true;
|
|
|
- }
|
|
|
-
|
|
|
- if (pwdCheck) {
|
|
|
- $avlPwd.show();
|
|
|
- } else {
|
|
|
- $avlPwd.hide();
|
|
|
- }
|
|
|
-
|
|
|
+ // 패스워드 저장
|
|
|
+ $('#btnSavePassword').on('click', function () {
|
|
|
+ let resetPasswordForm = $('#resetPasswordForm').serializeObject();
|
|
|
+ fnCheckPassword('#resetPasswordForm');
|
|
|
+ fnConfirmPassword('#resetPasswordForm');
|
|
|
+ let jsonData = JSON.stringify(resetPasswordForm);
|
|
|
+ ajaxJsonSubmit('/customer/password/reset', jsonData, fnSavePasswordCallback);
|
|
|
+ });
|
|
|
|
|
|
- }
|
|
|
+ var fnSavePasswordCallback = function (result) {
|
|
|
|
|
|
- var fnConfirmPassword = function () {
|
|
|
- let $misPwd = $('#misPwd');
|
|
|
- let $avlConPwd = $('#avlConPwd');
|
|
|
- let password = $("#resetPasswordForm input[name=password]").val();
|
|
|
- let confirmPassword = $('#confirmPassword').val();
|
|
|
- // 재입력 일치 여부
|
|
|
- if (password != confirmPassword) {
|
|
|
- $avlConPwd.hide();
|
|
|
- $misPwd.show()
|
|
|
- } else {
|
|
|
- $misPwd.hide();
|
|
|
- $avlConPwd.show();
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
- // 연속되는 문자
|
|
|
- var isContinuedValue = function (password) {
|
|
|
- console.log("password = " + password);
|
|
|
- var intCnt1 = 0;
|
|
|
- var intCnt2 = 0;
|
|
|
- var temp0 = "";
|
|
|
- var temp1 = "";
|
|
|
- var temp2 = "";
|
|
|
- var temp3 = "";
|
|
|
-
|
|
|
- for (var i = 0; i < password.length-3; i++) {
|
|
|
- console.log("=========================");
|
|
|
- temp0 = password.charAt(i);
|
|
|
- temp1 = password.charAt(i + 1);
|
|
|
- temp2 = password.charAt(i + 2);
|
|
|
- temp3 = password.charAt(i + 3);
|
|
|
-
|
|
|
- console.log(temp0)
|
|
|
- console.log(temp1)
|
|
|
- console.log(temp2)
|
|
|
- console.log(temp3)
|
|
|
-
|
|
|
- if (temp0.charCodeAt(0) - temp1.charCodeAt(0) == 1
|
|
|
- && temp1.charCodeAt(0) - temp2.charCodeAt(0) == 1
|
|
|
- && temp2.charCodeAt(0) - temp3.charCodeAt(0) == 1) {
|
|
|
- intCnt1 = intCnt1 + 1;
|
|
|
- }
|
|
|
|
|
|
- if (temp0.charCodeAt(0) - temp1.charCodeAt(0) == -1
|
|
|
- && temp1.charCodeAt(0) - temp2.charCodeAt(0) == -1
|
|
|
- && temp2.charCodeAt(0) - temp3.charCodeAt(0) == -1) {
|
|
|
- intCnt2 = intCnt2 + 1;
|
|
|
- }
|
|
|
- console.log("=========================");
|
|
|
- }
|
|
|
-
|
|
|
- console.log(intCnt1 > 0 || intCnt2 > 0);
|
|
|
- return (intCnt1 > 0 || intCnt2 > 0);
|
|
|
- }
|
|
|
|
|
|
|
|
|
/*]]>*/
|