mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-07 02:02:58 +09:00
로그인 및 메인 화면 수정 변경
This commit is contained in:
@@ -46,11 +46,13 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import api from '../service/api';
|
||||
import tokenSvc from '@/common/token-service';
|
||||
import { utils_mixin, chkPattern2 } from '../service/mixins';
|
||||
import LoginPopup from '@/components/LoginPopup.vue'
|
||||
import commonModal from "@/components/modal/commonModal";
|
||||
|
||||
export default {
|
||||
name: 'Params',
|
||||
mixins: [utils_mixin, chkPattern2],
|
||||
props: {
|
||||
userId: {
|
||||
type: String,
|
||||
@@ -63,7 +65,7 @@ export default {
|
||||
errors: [],
|
||||
mdn: '',
|
||||
confirmNum: '',
|
||||
userId: '',
|
||||
// userId: '',
|
||||
isAuthNum: false,
|
||||
isLogin: false,
|
||||
isAuth: false,
|
||||
@@ -141,13 +143,16 @@ export default {
|
||||
vm.$router.push({ path: '/'});
|
||||
return;
|
||||
}
|
||||
if (vm.mdn == null || vm.mdn.trim() == "" || vm.mdn.length < 11 || !vm.mdn){
|
||||
// vm.ModalOpen('modal06');
|
||||
this.row.title = '휴대폰번호 확인';
|
||||
this.row.msg1 = '휴대폰번호를 확인해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
|
||||
const hp = this.mdn;
|
||||
if(!this.isNull(hp) && !this.isMobile(hp)){
|
||||
this.row.title = '관리자/유치채널 관리';
|
||||
this.row.msg1 = '휴대폰 번호 형식이 잘못되었습니다. 확인해 주세요.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
this.$refs._phone.focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
var params = {
|
||||
"oprtrId": userId,
|
||||
"hpNo": this.mdn,
|
||||
@@ -163,8 +168,6 @@ export default {
|
||||
this.row.title = '인증번호 발송';
|
||||
this.row.msg1 = '인증번호를 발송하였습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
// vm.ModalOpen('modal07');
|
||||
// console.log('시간 3:00 카운트 하기');
|
||||
this.isAuthNum = true;
|
||||
}else if (!this.timer) {
|
||||
this.timerStop(this.timer);
|
||||
@@ -172,9 +175,6 @@ export default {
|
||||
this.row.title = '인증번호 발송';
|
||||
this.row.msg1 = '인증번호를 발송하였습니다.';
|
||||
this.$refs.commmonModal.alertModalOpen(this.row);
|
||||
// vm.ModalOpen('modal06');
|
||||
// 실패 -> 실패 코드에 따라 실패 팝업 보여주기
|
||||
//인증시간 초과 후 “시간초과!” 문구로 변경
|
||||
}
|
||||
} catch(err) {
|
||||
this.row.title = '로그인';
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
import api from '../service/api';
|
||||
import LoginPopup from '@/components/LoginPopup.vue';
|
||||
import tokenSvc from '@/common/token-service';
|
||||
import commonModal from "@/components/modal/commonModal";
|
||||
import commonModal from "../components/commonModal";
|
||||
|
||||
export default {
|
||||
data: function() {
|
||||
@@ -45,7 +45,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
// 로그인 페이지 진입시
|
||||
if(!!tokenSvc.getToken()){
|
||||
if(tokenSvc.getToken()){
|
||||
this.$store.commit("login/isLogin", true);
|
||||
this.$store.commit("login/isAuthChk", true);
|
||||
this.$router.push({ path: '/' });
|
||||
@@ -130,11 +130,14 @@ export default {
|
||||
} else if(rsp.retCode == '4004') { // ID/PWD 불일치
|
||||
this.row.title = '비밀번호 오류';
|
||||
this.row.msg1 = '비밀번호를 확인해주세요.';
|
||||
|
||||
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.row.callFnc = 'resetPassword'
|
||||
console.log(this.row)
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
} else if(rsp.retCode == '4006') {
|
||||
// msg = '비밀번호를 변경하신지 90일이 지났습니다.\n비밀번호 변경 화면으로 이동합니다.';
|
||||
@@ -172,6 +175,11 @@ export default {
|
||||
ModalOpen: function(target){
|
||||
this.$refs.LoginPopup.ModalOpen(target);
|
||||
},
|
||||
alertCalbackFnc(callFnc){
|
||||
if(callFnc === 'resetPassword'){
|
||||
this.$router.push({ name: 'resetPassword',params: {}});
|
||||
}
|
||||
},
|
||||
|
||||
} //method 끝
|
||||
};
|
||||
|
||||
@@ -1,42 +1,35 @@
|
||||
<template>
|
||||
|
||||
<div class="wrap bg-wrap">
|
||||
|
||||
<!-- s: 패스워드초기화 -->
|
||||
<div class="login-box pw-reset">
|
||||
<div class="logo"></div>
|
||||
<div class="wbox">
|
||||
<h3 class="title">비밀번호 초기화</h3>
|
||||
<!-- <form action=""> -->
|
||||
<div class="login-form">
|
||||
<div>
|
||||
<input type="text" placeholder="아이디를 입력하세요" v-model="userId"></div>
|
||||
<div class="button_group">
|
||||
<button class="btn-pcolor" @click="ajaxReset">비밀번호 초기화 문자 발송하기</button>
|
||||
<button class="btn-default" @click="clickMenu('/login')">취소</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </form> -->
|
||||
<div class="login-notice">
|
||||
<div>
|
||||
<li>초기화된 비밀번호는 등록된 휴대폰 문자메시지로 발송됩니다.</li>
|
||||
<li>휴대폰 번호 변경 시 관리자로 문의해주세요.</li>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<div class="login-box pw-reset">
|
||||
<div class="logo"></div>
|
||||
<div class="wbox">
|
||||
<h3 class="title">비밀번호 초기화</h3>
|
||||
<ul class="login-form">
|
||||
<li><input type="text" placeholder="아이디를 입력하세요" v-model="userId"></li>
|
||||
<li>
|
||||
<button class="btn-pcolor" @click="ajaxReset">비밀번호 초기화 문자 발송하기</button>
|
||||
<button class="btn-default" @click="clickMenu('/login')">취소</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="login-notice">
|
||||
<ul>
|
||||
<li>초기화된 비밀번호는 등록된 휴대폰 문자메시지로 발송됩니다.</li>
|
||||
<li>휴대폰 번호 변경 시 관리자로 문의해주세요.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<common-modal ref="commonModal"></common-modal>
|
||||
<login-popup ref="LoginPopup"> </login-popup>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import api from '../service/api';
|
||||
import LoginPopup from '@/components/LoginPopup.vue';
|
||||
import commonModal from "@/components/modal/commonModal";
|
||||
import commonModal from "../components/commonModal";
|
||||
|
||||
export default {
|
||||
name: 'resetPassword',
|
||||
@@ -48,7 +41,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$store.commit("login/isLogin", false);
|
||||
this.$store.commit("login/isLogin", true);
|
||||
this.$store.commit("login/isAuthChk", false);
|
||||
},
|
||||
components: {
|
||||
@@ -85,40 +78,42 @@ export default {
|
||||
console.log("RESULT_CODE : "+rsp.retCode);
|
||||
|
||||
if(rsp.retCode == '0000'){
|
||||
// vm.$store.commit("login/isLogin", true);
|
||||
//vm.$store.commit("login/isAuthChk", true);
|
||||
this.row.title = '비밀번호 초기화';
|
||||
this.row.msg1 = '해당 아이디에 저장되어 있는 핸드폰번호로';
|
||||
this.row.msg2 = '비밀번호 초기화 문자가 발송되었습니다.';
|
||||
this.row.callFnc = 'login'
|
||||
vm.$store.commit("login/isLogin", false);
|
||||
vm.$store.commit("login/isAuthChk", false);
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
// vm.ModalOpen('modal12');
|
||||
//vm.$router.push({ path : 'view/login'});
|
||||
// console.log(this.row)
|
||||
|
||||
} else if(rsp.retCode == '4003') {
|
||||
this.row.title = '비밀번호 초기화';
|
||||
this.row.msg1 = '등록되지 않은 아이디입니다.';
|
||||
this.row.msg2 = '아이디를 다시 확인하세요.';
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
// vm.ModalOpen('modal13');
|
||||
}
|
||||
// document.getElementsByClassName('modal12')[0].getElementsByClassName('btn-pcolor')[0].addEventListener('click',() => {
|
||||
// vm.$router.push({path: '/login'});
|
||||
} catch(err) {
|
||||
//alert("실패 하였습니다.");
|
||||
console.log(err)
|
||||
this.row.title = '비밀번호 초기화';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
,
|
||||
clickMenu(link) {
|
||||
this.$router.push({path: link});
|
||||
},
|
||||
},
|
||||
clickMenu(link) {
|
||||
this.$router.push({path: link});
|
||||
},
|
||||
|
||||
ModalOpen: function(target){
|
||||
this.$refs.LoginPopup.ModalOpen(target);
|
||||
},
|
||||
ModalOpen: function(target){
|
||||
this.$refs.LoginPopup.ModalOpen(target);
|
||||
},
|
||||
alertCalbackFnc(callFnc){
|
||||
if(callFnc === 'login'){
|
||||
this.$router.push({ name: 'login',params: {}});
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,25 +1,19 @@
|
||||
<template>
|
||||
<div class="wrap bg-wrap">
|
||||
<!-- s: 비밀번호변경 -->
|
||||
<div id="cpf" class="login-box pw-change">
|
||||
<div>
|
||||
<div class="login-box pw-change">
|
||||
<div class="logo"></div>
|
||||
<div class="wbox">
|
||||
<h3 class="title">비밀번호 변경</h3>
|
||||
<p class="desc">임시비밀번호로 로그인할 경우 비밀번호를 변경 후<br>서비스 이용이 가능합니다.</p>
|
||||
<form @submit.prevent="changedPwd">
|
||||
<ul class="pw-form">
|
||||
<div><input id="oldPw" type="password" placeholder="기존 비밀번호를 입력하세요" v-model="oldPw" ref="oldPw"></div>
|
||||
<div>
|
||||
<input id="newPw" type="password" placeholder="새로운 비밀번호를 입력하세요" required minlength="8" maxlength="16" v-model.trim="newPw" ref="_newPw">
|
||||
</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>
|
||||
<li><input type="password" placeholder="기존 비밀번호를 입력하세요" v-model="oldPw" ref="oldPw"></li>
|
||||
<li><input type="password" placeholder="새로운 비밀번호를 입력하세요" required minlength="8" maxlength="16" v-model.trim="newPw" ref="_newPw"></li>
|
||||
<li><input type="password" placeholder="새로운 비밀번호를 다시 한 번 입력하세요" required minlength="8" maxlength="16" v-model.trim="newPw2" ref="_newPw2"></li>
|
||||
<li><button class="btn-pcolor" @click="changedPwd()">비밀번호 변경하기</button></li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<common-modal ref="commonModal"></common-modal>
|
||||
<login-popup ref="LoginPopup"> </login-popup>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -29,10 +23,9 @@
|
||||
import lodash from "lodash";
|
||||
import api from '../service/api';
|
||||
import { mapGetters } from 'vuex';
|
||||
import LoginPopup from '@/components/LoginPopup.vue';
|
||||
import tokenSvc from '@/common/token-service';
|
||||
import { commonPwdView, validation } from '../service/mixins';
|
||||
import commonModal from "@/components/modal/commonModal";
|
||||
import commonModal from "../components/commonModal";
|
||||
|
||||
export default {
|
||||
mixins: [commonPwdView, validation],
|
||||
@@ -48,20 +41,13 @@ export default {
|
||||
},
|
||||
|
||||
created: function() {
|
||||
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' });
|
||||
// }
|
||||
}
|
||||
this.$store.commit("login/isLogin", true);
|
||||
this.$store.commit("login/isAuthChk", false);
|
||||
},
|
||||
mounted() {
|
||||
mounted() {
|
||||
// this.$refs.chkSaveId.checked = true;
|
||||
|
||||
if (localStorage.hubwebUserId) {
|
||||
if (localStorage.hubwebUserId) {
|
||||
this.userId = localStorage.hubwebUserId;
|
||||
}
|
||||
this.isLogin = this.getLogin;
|
||||
@@ -72,16 +58,16 @@ export default {
|
||||
...mapGetters({
|
||||
getLogin: 'login/isLogin',
|
||||
getPwd: 'login/getPwd'
|
||||
}),
|
||||
}),
|
||||
},
|
||||
|
||||
watch: {
|
||||
getLogin(data) {
|
||||
getLogin(data) {
|
||||
if (data != null && data != '' && data == true) {
|
||||
this.isLogin = true;
|
||||
this.isLogin = true;
|
||||
} else {
|
||||
this.isLogin = false;
|
||||
}
|
||||
this.isLogin = false;
|
||||
}
|
||||
},
|
||||
getPwd(data) {
|
||||
if(data != null && data != ''){
|
||||
@@ -91,7 +77,6 @@ export default {
|
||||
},
|
||||
|
||||
components: {
|
||||
LoginPopup : LoginPopup,
|
||||
commonModal,
|
||||
},
|
||||
|
||||
@@ -148,7 +133,7 @@ export default {
|
||||
},
|
||||
|
||||
//비밀번호 유효성 체크
|
||||
changedPwd: function() {
|
||||
async changedPwd() {
|
||||
|
||||
if(this.doPwdValidate()){
|
||||
var vm = this;
|
||||
@@ -159,11 +144,10 @@ export default {
|
||||
"oldPw": this.oldPw,
|
||||
"newPw": this.newPw
|
||||
}
|
||||
|
||||
api.updatePassword(params).then(function(response) {
|
||||
var rsp = response.data;
|
||||
// var pofo = document.getElementById('oldPw');
|
||||
|
||||
try {
|
||||
const response = await api.updatePassword(params)
|
||||
const rsp = response.data;
|
||||
console.log("RESULT_CODE : "+rsp.retCode);
|
||||
if(rsp.retCode == '0000') {
|
||||
// vm.chgChkUserId();
|
||||
this.row.title = '비밀번호 변경';
|
||||
@@ -188,11 +172,50 @@ export default {
|
||||
} else if(rsp.retCode == '4003') {
|
||||
this.row.title = '아이디 오류';
|
||||
this.row.msg1 = '등록되지 않은 아이디입니다.';
|
||||
this.row.msg1 = '아이디를 다시 확인하세요';
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
|
||||
}
|
||||
});
|
||||
} catch(err) {
|
||||
//alert("실패 하였습니다.");
|
||||
console.log(err)
|
||||
this.row.title = '비밀번호 초기화';
|
||||
this.row.msg1 = '실패 하였습니다.';
|
||||
this.$refs.commonModal.alertModalOpen(this.row);
|
||||
return false;
|
||||
}
|
||||
// api.updatePassword(params).then(function(response) {
|
||||
// var rsp = response.data;
|
||||
// // var pofo = document.getElementById('oldPw');
|
||||
//
|
||||
// if(rsp.retCode == '0000') {
|
||||
// // vm.chgChkUserId();
|
||||
// this.row.title = '비밀번호 변경';
|
||||
// this.row.msg1 = '비밀번호가 정상적으로 변경되었습니다.';
|
||||
// this.row.msg2 = '변경된 비밀번호로 다시 로그인 해주세요.';
|
||||
// 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.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.commonModal.alertModalOpen(this.row);
|
||||
// // vm.ModalOpen('modal15')
|
||||
// } else if(rsp.retCode == '4003') {
|
||||
// this.row.title = '아이디 오류';
|
||||
// this.row.msg1 = '등록되지 않은 아이디입니다.';
|
||||
// this.row.msg1 = '아이디를 다시 확인하세요';
|
||||
// this.$refs.commonModal.alertModalOpen(this.row);
|
||||
//
|
||||
// }
|
||||
// });
|
||||
|
||||
}
|
||||
},
|
||||
@@ -211,7 +234,7 @@ export default {
|
||||
return length;
|
||||
},
|
||||
ModalOpen: function(target){
|
||||
this.$refs.LoginPopup.ModalOpen(target);
|
||||
// this.$refs.LoginPopup.ModalOpen(target);
|
||||
// this.$refs.oldPw.focus(target);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user