|
|
|
@ -7,105 +7,74 @@
|
|
|
|
|
<h1 class="header_title">계정관리</h1>
|
|
|
|
|
<a href="#" class="side_Rbtn hidden"></a>
|
|
|
|
|
</header>
|
|
|
|
|
<main class="m_set_account m_set_account_password">
|
|
|
|
|
<form name="frmMember" id="frmMember" method="post">
|
|
|
|
|
<div class="l_list">
|
|
|
|
|
<h1 class="l_title">현재 비밀번호 입력해주세요</h1>
|
|
|
|
|
<div class="p_list_item p_border_box">
|
|
|
|
|
<div class="p_input_box">
|
|
|
|
|
<input type="password" id="password_now" name="password_now" class="required" data-tit="현재 비밀번호" placeholder="현재 비밀번호를 입력해 주세요.">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<form name="frmMember" id="frmMember" method="post">
|
|
|
|
|
<div id="search_id" class="search_id">
|
|
|
|
|
<div class="search_phone">
|
|
|
|
|
<h3>현재 비밀번호</h3>
|
|
|
|
|
<div class="input_search_phone">
|
|
|
|
|
<input type="password" id="password_now" name="password_now" value="" maxlength="15" placeholder="현재 비밀번호를 입력해 주세요." class="input_box" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="l_list">
|
|
|
|
|
<h1 class="l_title">새로운 비밀번호 입력해주세요</h1>
|
|
|
|
|
<div class="p_list_item p_border_box">
|
|
|
|
|
<div class="p_input_box border_b">
|
|
|
|
|
<input type="password" id="password_1" name="password_1" class="required" data-tit="비밀번호" placeholder="영문/숫자/특수문자 2조합 9~15자 이내로 작성해 주세요." >
|
|
|
|
|
</div>
|
|
|
|
|
<p>새로운 비밀번호</p>
|
|
|
|
|
<div class="input_search_phone" style="padding-bottom:10px">
|
|
|
|
|
<input type="password" id="password_1" name="password_1" maxlength="15" placeholder="영문/숫자/특수문자 2조합 9~15자 이내로 작성해 주세요." class="input_box" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="input_search_phone" style="padding-top:0px">
|
|
|
|
|
<input type="password" id="password_2" name="password_2" maxlength="15" placeholder="비밀번호를 확인해 주세요." class="input_box" />
|
|
|
|
|
</div>
|
|
|
|
|
<div class="p_list_item p_border_box">
|
|
|
|
|
<div class="p_input_box">
|
|
|
|
|
<input type="password" id="password_2" name="password_2" class="required" data-tit="비밀번호 재입력" placeholder="비밀번호를 확인해 주세요." >
|
|
|
|
|
</div>
|
|
|
|
|
<div class="input_search_phone_btn">
|
|
|
|
|
<a href="javascript:fncSubmit();">변경하기</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="m_set_account_btn"><button type="submit" id="" name="" class="btns blue_btn">변경하기</button></div>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
<#include "/m/include/index_bottom_info.ftl">
|
|
|
|
|
</main>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<script>
|
|
|
|
|
var member = {
|
|
|
|
|
|
|
|
|
|
is_loading: false,
|
|
|
|
|
|
|
|
|
|
init: function(){
|
|
|
|
|
$('#frmMember').on('submit',function(e){
|
|
|
|
|
|
|
|
|
|
if(this.is_loading) {
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!SNValidator.validateWithAlert('#frmMember')) {
|
|
|
|
|
this.is_loading = false
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
return;
|
|
|
|
|
}else if($('#password_1').val() != $('#password_2').val()){
|
|
|
|
|
Swal.fire({text: '입력하신 비밀번호가 서로 다릅니다'})
|
|
|
|
|
this.is_loading = false
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
return;
|
|
|
|
|
}else if($('#password_1').val() == $('#password_now').val()){
|
|
|
|
|
Swal.fire({text: '기존 비밀번호와 다른 비밀번호를 입력하세요'})
|
|
|
|
|
this.is_loading = false
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
return;
|
|
|
|
|
}else if(!SNUtil.regPw.test($("#password_1").val())){
|
|
|
|
|
Swal.fire({text: '6-15자 이내의 비밀번호를 입력해주세요'})
|
|
|
|
|
this.is_loading = false
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var data = $('#frmMember').serialize()
|
|
|
|
|
$.ajax({
|
|
|
|
|
url:'${URL_ROOT}/m/member_env/ajax_update_member_pwd.do',
|
|
|
|
|
type: 'post',
|
|
|
|
|
data: data,
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
error:function(request,status,error){
|
|
|
|
|
this.is_loading = false
|
|
|
|
|
Swal.fire({text: '오류가 발생했습니다'})
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
return;
|
|
|
|
|
}.bind('this'),
|
|
|
|
|
success:function(result){
|
|
|
|
|
console.log(result)
|
|
|
|
|
this.is_loading = false;
|
|
|
|
|
var RESULT = result.RESULT
|
|
|
|
|
if(RESULT == 0){ //0:RESULT_SUCCESS
|
|
|
|
|
Swal.fire({html: '변경되었습니다<br/>새로운 비밀번호로 다시 로그인 해주세요'}).then((result) => { location.href="${URL_ROOT}/m/login/view_login.do" })
|
|
|
|
|
}else if(RESULT == 5){ //5: RESULT_CUSTOM_MSG
|
|
|
|
|
Swal.fire({html: result.MSG})
|
|
|
|
|
}else{
|
|
|
|
|
Swal.fire({text: '변경에 실패했습니다'})
|
|
|
|
|
}
|
|
|
|
|
}.bind('this'),
|
|
|
|
|
})
|
|
|
|
|
function fncSubmit() {
|
|
|
|
|
if($('#password_1').val() != $('#password_2').val()){
|
|
|
|
|
Swal.fire({text: '입력하신 비밀번호가 서로 다릅니다'})
|
|
|
|
|
this.is_loading = false
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
return;
|
|
|
|
|
}else if($('#password_1').val() == $('#password_now').val()){
|
|
|
|
|
Swal.fire({text: '기존 비밀번호와 다른 비밀번호를 입력하세요'})
|
|
|
|
|
this.is_loading = false
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
return;
|
|
|
|
|
}else if(!SNUtil.regPw.test($("#password_1").val())){
|
|
|
|
|
Swal.fire({text: '6-15자 이내의 비밀번호를 입력해주세요'})
|
|
|
|
|
this.is_loading = false
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var data = $('#frmMember').serialize()
|
|
|
|
|
$.ajax({
|
|
|
|
|
url:'${URL_ROOT}/m/member_env/ajax_update_member_pwd.do',
|
|
|
|
|
type: 'post',
|
|
|
|
|
data: data,
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
error:function(request,status,error){
|
|
|
|
|
this.is_loading = false
|
|
|
|
|
Swal.fire({text: '오류가 발생했습니다'})
|
|
|
|
|
e.preventDefault()
|
|
|
|
|
return;
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}.bind('this'),
|
|
|
|
|
success:function(result){
|
|
|
|
|
console.log(result)
|
|
|
|
|
this.is_loading = false;
|
|
|
|
|
var RESULT = result.RESULT
|
|
|
|
|
if(RESULT == 0){ //0:RESULT_SUCCESS
|
|
|
|
|
Swal.fire({html: '변경되었습니다<br/>새로운 비밀번호로 다시 로그인 해주세요'}).then((result) => { location.href="${URL_ROOT}/m/login/view_login.do" })
|
|
|
|
|
}else if(RESULT == 5){ //5: RESULT_CUSTOM_MSG
|
|
|
|
|
Swal.fire({html: result.MSG})
|
|
|
|
|
}else{
|
|
|
|
|
Swal.fire({text: '변경에 실패했습니다'})
|
|
|
|
|
}
|
|
|
|
|
}.bind('this'),
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$(function(){
|
|
|
|
|
member.init()
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<#include "/m/member_env/include_return_url.ftl">
|
|
|
|
|
|
|
|
|
|