시스템관리 - 권한관리, 고객관리 - 청약고객관리/회원관리 추가

This commit is contained in:
kimre
2022-06-09 21:36:05 +09:00
parent b832e1a0be
commit 940707deaa
113 changed files with 9134 additions and 2100 deletions

View File

@@ -49,6 +49,13 @@
//import * as utils from '@/common/utils';
export default {
name: 'Params',
props: {
userId: {
type: String,
default : ''
}
},
data: function() {
return {
errors: [],
@@ -116,6 +123,7 @@
// 2차 인증번호 요청
authNum(){
var vm = this;
let userId = vm.$route.params.userId;
if(!this.isLogin){
vm.$store.commit("login/isLogin", false);
vm.$store.commit("login/isAuthChk", false);
@@ -127,7 +135,7 @@
return false;
}
var params = {
"oprtrId": this.userId,
"oprtrId": userId,
"hpNo": this.mdn,
"isLogin" : this.isLogin
}
@@ -156,6 +164,7 @@
// 2차 인증 확인
ajaxAuth: function(){
var vm = this;
let userId = vm.$route.params.userId;
if (!vm.formCheck()){
alert(vm.errors[0]);
return false;
@@ -168,7 +177,7 @@
var params = {
"oprtrId": this.userId,
"oprtrId": userId,
"hpNo": this.mdn,
"chrVal": this.confirmNum,
"isLogin": this.isLogin,

View File

@@ -96,6 +96,7 @@
if (!vm.formCheck()) return false;
let oprtrId = this.userId;
let oprtrPw = this.userPwd;
// FormData 객체를 파라미터로 넘기면 Content-Type: multipart/form-data; 요청을 한다.
@@ -108,14 +109,14 @@
api.login(params).then(function(response) {
var rsp = response.data;
if(rsp.retCode == '0000'){
var path = rsp.data.nextUrl;
console.log(path);
vm.chgChkUserId();
vm.$store.commit("login/isLogin", true);
vm.$store.commit("login/savePwd", oprtrPw);
vm.$router.push({ path: '/view/login/auth'});
vm.$router.push({ name: 'loginAuth',params: {userId : oprtrId}});
} else if(rsp.retCode == '4004') { // ID/PWD 불일치
vm.errors.push('로그인 실패하였습니다. (5회 실패 시 계정 잠김)');
vm.ModalOpen('modal01');

View File

@@ -86,12 +86,16 @@ export default {
//vm.$store.commit("login/isAuthChk", true);
vm.ModalOpen('modal12');
// vm.$router.push({ path : 'view/login'});
//vm.$router.push({ path : 'view/login'});
} else if(rsp.retCode == '4003') {
vm.ModalOpen('modal13');
} else {
return;
}
document.getElementsByClassName('modal12')[0].getElementsByClassName('btn-pcolor')[0].addEventListener('click',() => {
vm.$router.push({path: '/login'});
});
});
}
,

View File

@@ -8,11 +8,11 @@
<p class="desc">임시비밀번호로 로그인할 경우 비밀번호를 변경 <br>서비스 이용이 가능합니다.</p>
<form @submit.prevent="changedPwd">
<ul class="pw-form">
<div><input id="oldPw" type="text" placeholder="기존 비밀번호를 입력하세요" v-model="oldPw" ref="oldPw"></div>
<div><input id="oldPw" type="password" placeholder="기존 비밀번호를 입력하세요" v-model="oldPw" ref="oldPw"></div>
<div>
<input id="newPw" type="text" placeholder="새로운 비밀번호를 입력하세요" v-model="newPw" ref="newPw" maxlength="16">
<input id="newPw" type="password" placeholder="새로운 비밀번호를 입력하세요" required minlength="8" maxlength="16" v-model.trim="newPw" ref="_newPw">
</div>
<div><input type="text" placeholder="새로운 비밀번호를 다시 한 번 입력하세요" ></div>
<div><input type="password" placeholder="새로운 비밀번호를 다시 한 번 입력하세요" required minlength="8" maxlength="16" v-model.trim="newPw2" ref="_newPw2"></div>
<div><button class="btn-pcolor" @click="changedPwd()">비밀번호 변경하기</button></div>
</ul>
</form>
@@ -25,6 +25,7 @@
</template>
<script>
import lodash from "lodash";
import api from '../service/api';
import { mapGetters } from 'vuex';
import LoginPopup from '@/components/LoginPopup.vue';
@@ -39,6 +40,7 @@ export default {
userId: '',
oldPw: '',
newPw: '',
newPw2: '',
passwordValidFlag: true,
};
},
@@ -105,58 +107,97 @@ export default {
return this.errors.length == 0;
},
changedPwd: function() {
var vm = this;
var params = {
"userId": this.userId,
"oldPw": this.oldPw,
"newPw": this.newPw
doPwdValidate(){
debugger;
if(lodash.isNil(this.newPw)){
alert("비밀번호 확인을 입력해 주세요.");
this.$refs._newPw2.focus();
return false;
}
api.updatePassword(params).then(function(response) {
var rsp = response.data;
// var pofo = document.getElementById('oldPw');
if(rsp.retCode == '0000') {
// vm.chgChkUserId();
if(vm.ModalOpen('modal16')){
vm.$router.push({ path: '/login' });
}
} else if(rsp.retCode == '4016') {
vm.ModalOpen('modal14')
} else if(rsp.retCode == '4017') {
vm.ModalOpen('modal15')
} else if(rsp.retCode == '4003') {
if(vm.ModalOpen('modal14')) {
//수정사항 : 모달오픈 -> 기존비밀번호 포커스
alert('1');
}
// //this.$refs.oldPw.focus();
// alert('비밀번호 유효성체크');
// vm.$refs.oldPw.focus();
}
else {
return;
}
});
if(!lodash.isEqual(this.newPw, this.newPw2)){
alert("비밀번호가 일치하지 않습니다.");
this.$refs._newPw2.focus();
return false;
}
const pwdLen = this.bytes(this.newPw);
if(!(pwdLen >= 8 && pwdLen <= 16)){
alert("비밀번호는 8~16자의 영문, 숫자, 특수문자(!,@, $, %, ^, &, *) 조합이 필요합니다.");
this.$refs._newPw2.focus();
return false;
}
const pEng = /[A-Za-z]/g; // 영문자
const pNum = /[0-9]/g; // 숫자
const pSpc = /[!@$%^&*]/g; // 특수문자
if(!(pEng.test(this.newPw) && pNum.test(this.newPw) && pSpc.test(this.newPw))) {
alert("비밀번호는 8~16자의 영문, 숫자, 특수문자(!,@, $, %, ^, &, *) 조합이 필요합니다.");
this.$refs._newPw2.focus();
return;
}
return true;
},
//비밀번호 유효성 체크
changedPwd: function() {
if(this.doPwdValidate()){
var vm = this;
var params = {
"userId": this.userId,
"oldPw": this.oldPw,
"newPw": this.newPw
}
api.updatePassword(params).then(function(response) {
var rsp = response.data;
// var pofo = document.getElementById('oldPw');
if(rsp.retCode == '0000') {
// vm.chgChkUserId();
if(vm.ModalOpen('modal16')){
vm.$router.push({ path: '/login' });
}
} else if(rsp.retCode == '4016') {
vm.ModalOpen('modal14')
} else if(rsp.retCode == '4017') {
vm.ModalOpen('modal15')
} else if(rsp.retCode == '4003') {
if(vm.ModalOpen('modal14')) {
//수정사항 : 모달오픈 -> 기존비밀번호 포커스
alert('1');
}
// //this.$refs.oldPw.focus();
// alert('비밀번호 유효성체크');
// vm.$refs.oldPw.focus();
}
else {
return;
}
});
}
},
bytes: function (str) {
var length = ((s,b,i,c) => {
b=0,i=0;
while(1 === 1){
c = s.charCodeAt(i++);
if (isNaN(c)) {
break;
}
b += c >> 11 ? 2 : c >> 7 ? 1 : 1;
}
return b
})(str);
return length;
},
ModalOpen: function(target){
this.$refs.LoginPopup.ModalOpen(target);
// this.$refs.oldPw.focus(target);
},
}
}
}