mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-07 02:59:22 +09:00
로그인 관련 / 메뉴 링크 추가 / 홈페이지 로그인 적용
This commit is contained in:
@@ -65,7 +65,8 @@ export default {
|
||||
confirmNum: '',
|
||||
userId: '',
|
||||
isAuthNum: false,
|
||||
isLogin: true,
|
||||
isLogin: false,
|
||||
isAuth: false,
|
||||
pwd: '',
|
||||
text: '',
|
||||
number: '',
|
||||
@@ -79,15 +80,15 @@ export default {
|
||||
,commonModal
|
||||
},
|
||||
created() {
|
||||
if(!!tokenSvc.getToken()){
|
||||
this.$store.commit("login/isLogin", true);
|
||||
this.$store.commit("login/isAuthChk", true);
|
||||
this.$router.push({ path: '/' });
|
||||
}else{
|
||||
if(!this.getLogin){
|
||||
this.$router.push({ path: '/login' });
|
||||
}
|
||||
}
|
||||
// if(!!tokenSvc.getToken()){
|
||||
// this.$store.commit("login/isLogin", true);
|
||||
// this.$store.commit("login/isAuthChk", true);
|
||||
// this.$router.push({ path: '/' });
|
||||
// }else{
|
||||
// if(!this.getLogin){
|
||||
// this.$router.push({ path: '/login' });
|
||||
// }
|
||||
// }
|
||||
},
|
||||
mounted() {
|
||||
if (localStorage.hubwebUserId) {
|
||||
@@ -116,6 +117,13 @@ export default {
|
||||
if(data != null && data != ''){
|
||||
this.pwd = data;
|
||||
}
|
||||
},
|
||||
getAuthChk(data){
|
||||
if (data != null && data != '' && data == true) {
|
||||
this.isAuth = true;
|
||||
} else {
|
||||
this.isAuth = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
destroyed() {
|
||||
@@ -216,11 +224,13 @@ export default {
|
||||
try {
|
||||
const response = await api.confirmNum(params)
|
||||
const rsp = response.data;
|
||||
console.log("RESULT_CODE : "+rsp.retCode);
|
||||
console.log("LOGIN ßRESUßLT_CODE : "+rsp.retCode);
|
||||
console.log(rsp);
|
||||
if(rsp.retCode == '0000'){
|
||||
vm.$store.commit("login/isLogin", true);
|
||||
//var nextUrl = rsp.data.nextUrl;
|
||||
//vm.$router.push({ path: nextUrl});
|
||||
vm.$store.commit("login/isAuthChk", true);
|
||||
vm.$store.commit("login/userId", rsp.data.userId)
|
||||
vm.$store.commit("login/userNm", rsp.data.userNm)
|
||||
vm.$router.push({ path: '/'});
|
||||
}else if (rsp.retCode == '4008'){
|
||||
this.row.title = '휴대폰번호 확인';
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<template>
|
||||
<div class="wrap bg-wrap">
|
||||
<div class="login-box adm-login">
|
||||
<div class="wbox">
|
||||
<div class="logo"></div>
|
||||
@@ -23,10 +22,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<login-popup ref="LoginPopup"> </login-popup>
|
||||
<common-modal ref="commmonModal"></common-modal>
|
||||
</div>
|
||||
<common-modal ref="commonModal"></common-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -92,13 +90,13 @@ export default {
|
||||
if (!this.userId){
|
||||
this.row.title = '로그인 실패';
|
||||
this.row.msg1 = '아이디,비밀번호를 확인해주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
if (!this.userPwd){
|
||||
this.row.title = '비밀번호 오류';
|
||||
this.row.msg1 = '비밀번호를 확인해주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -128,28 +126,29 @@ export default {
|
||||
this.row.title = '로그인 실패';
|
||||
this.row.msg1 = '등록되지 않은 아이디입니다.';
|
||||
this.row.msg2 = '아이디를 다시 확인하세요';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
} else if(rsp.retCode == '4004') { // ID/PWD 불일치
|
||||
this.row.title = '비밀번호 오류';
|
||||
this.row.msg1 = '비밀번호를 확인해주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
} else if(rsp.retCode == '4005') { // ID/PWD 불일치 횟수초과로 계정 잠김 4005
|
||||
this.row.title = '로그인 실패';
|
||||
this.row.msg1 = '로그인 5회 실패하였습니다.';
|
||||
this.row.msg2 = '비밀번호 초기화 후 비밀번호를 변경해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
} else if(rsp.retCode == '4006') {
|
||||
// msg = '비밀번호를 변경하신지 90일이 지났습니다.\n비밀번호 변경 화면으로 이동합니다.';
|
||||
this.row.title = '로그인 실패';
|
||||
this.row.msg1 = '비밀번호를 변경하지 않은지 90일이';
|
||||
this.row.msg2 = '지났습니다. 비밀번호를 변경하여';
|
||||
this.row.msg3 = '이용 부탁드립니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
vm.$router.push({ name: 'updatePassword',params: {userId : oprtrId}});
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
} else if(rsp.retCode == '4007') {
|
||||
this.row.title = '로그인 실패';
|
||||
this.row.msg1 = '아이디 상태를 확인해 주세요.';
|
||||
this.row.msg2 = '(사용중인 상태만 로그인 가능합니다.)';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
} else {
|
||||
vm.$store.commit("login/isLogin", false);
|
||||
return;
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<common-modal ref="commonModal"></common-modal>
|
||||
<login-popup ref="LoginPopup"> </login-popup>
|
||||
<common-modal ref="commmonModal"></common-modal>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -44,6 +44,7 @@ export default {
|
||||
return {
|
||||
errors: [],
|
||||
userId: '',
|
||||
row:{},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -61,7 +62,7 @@ export default {
|
||||
if (!this.userId) {
|
||||
this.row.title = '아이디 오류';
|
||||
this.row.msg1 = '아이디를 입력해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
// this.errors.push('아이디를 입력해 주세요.');
|
||||
}
|
||||
|
||||
@@ -89,7 +90,7 @@ export default {
|
||||
this.row.title = '비밀번호 초기화';
|
||||
this.row.msg1 = '해당 아이디에 저장되어 있는 핸드폰번호로';
|
||||
this.row.msg2 = '비밀번호 초기화 문자가 발송되었습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
// vm.ModalOpen('modal12');
|
||||
//vm.$router.push({ path : 'view/login'});
|
||||
|
||||
@@ -97,7 +98,7 @@ export default {
|
||||
this.row.title = '비밀번호 초기화';
|
||||
this.row.msg1 = '등록되지 않은 아이디입니다.';
|
||||
this.row.msg2 = '아이디를 다시 확인하세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
// vm.ModalOpen('modal13');
|
||||
}
|
||||
// document.getElementsByClassName('modal12')[0].getElementsByClassName('btn-pcolor')[0].addEventListener('click',() => {
|
||||
@@ -106,7 +107,7 @@ export default {
|
||||
//alert("실패 하였습니다.");
|
||||
this.row.title = '비밀번호 초기화';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<common-modal ref="commonModal"></common-modal>
|
||||
<login-popup ref="LoginPopup"> </login-popup>
|
||||
<common-modal ref="commmonModal"></common-modal>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ export default {
|
||||
newPw: '',
|
||||
newPw2: '',
|
||||
passwordValidFlag: true,
|
||||
row: {},
|
||||
};
|
||||
},
|
||||
|
||||
@@ -114,14 +115,14 @@ export default {
|
||||
if(lodash.isNil(this.newPw)){
|
||||
this.row.title = '비밀번호 변경';
|
||||
this.row.msg1 = '비밀번호 확인을 입력해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
this.$refs._newPw2.focus();
|
||||
return false;
|
||||
}
|
||||
if(!lodash.isEqual(this.newPw, this.newPw2)){
|
||||
this.row.title = '비밀번호 변경';
|
||||
this.row.msg1 = '비밀번호가 일치하지 않습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
this.$refs._newPw2.focus();
|
||||
return false;
|
||||
}
|
||||
@@ -129,7 +130,7 @@ export default {
|
||||
if(!(pwdLen >= 8 && pwdLen <= 16)){
|
||||
this.row.title = '비밀번호 변경';
|
||||
this.row.msg1 = '비밀번호는 8~16자의 영문, 숫자, 특수문자(!,@, $, %, ^, &, *) 조합이 필요합니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
this.$refs._newPw2.focus();
|
||||
return false;
|
||||
}
|
||||
@@ -139,7 +140,7 @@ export default {
|
||||
if(!(pEng.test(this.newPw) && pNum.test(this.newPw) && pSpc.test(this.newPw))) {
|
||||
this.row.title = '비밀번호 변경';
|
||||
this.row.msg1 = '비밀번호는 8~16자의 영문, 숫자, 특수문자(!,@, $, %, ^, &, *) 조합이 필요합니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
this.$refs._newPw2.focus();
|
||||
return;
|
||||
}
|
||||
@@ -168,27 +169,27 @@ export default {
|
||||
this.row.title = '비밀번호 변경';
|
||||
this.row.msg1 = '비밀번호가 정상적으로 변경되었습니다.';
|
||||
this.row.msg2 = '변경된 비밀번호로 다시 로그인 해주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
// if(vm.ModalOpen('modal16')){
|
||||
vm.$router.push({ path: '/login' });
|
||||
// }
|
||||
} else if(rsp.retCode == '4016') {
|
||||
this.row.title = '비밀번호 변경';
|
||||
this.row.msg1 = '비밀번호를 확인해주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
// vm.ModalOpen('modal14')
|
||||
} else if(rsp.retCode == '4017') {
|
||||
this.row.title = '비밀번호 오류';
|
||||
this.row.msg1 = '비밀번호를 사용할 수 없습니다.';
|
||||
this.row.msg2 = '비밀번호는 영문/숫자/특수기호를 혼합하여';
|
||||
this.row.msg3 = '8~16자리로 설정해주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
// vm.ModalOpen('modal15')
|
||||
} else if(rsp.retCode == '4003') {
|
||||
this.row.title = '아이디 오류';
|
||||
this.row.msg1 = '등록되지 않은 아이디입니다.';
|
||||
this.row.msg1 = '아이디를 다시 확인하세요';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user