mirror of
http://git.mhez-qa.uplus.co.kr/hubez/hubez-admin.git
synced 2025-12-07 01:04:20 +09:00
로그인 수정
This commit is contained in:
@@ -6,10 +6,10 @@
|
||||
<div class="wbox">
|
||||
<h3 class="title">2차 휴대폰 문자 인증</h3>
|
||||
<p class="desc">아이디에 등록된 휴대폰번호를 입력해 주세요.</p>
|
||||
<!-- <form action=""> -->
|
||||
<ul class="pw-form">
|
||||
<div>
|
||||
<li><input type="text"
|
||||
ref="_phone"
|
||||
placeholder="휴대폰번호를 입력하세요 (숫자만 입력하세요.)"
|
||||
v-model="mdn"
|
||||
:maxlength="11"
|
||||
@@ -32,11 +32,9 @@
|
||||
<button class="btn-pcolor" v-on:click="ajaxAuth">확인</button>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- </form> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<login-popup ref="LoginPopup"> </login-popup>
|
||||
</div>
|
||||
<common-modal ref="commmonModal"></common-modal>
|
||||
</div>
|
||||
|
||||
@@ -45,9 +43,7 @@
|
||||
<script>
|
||||
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/commonModal";
|
||||
|
||||
export default {
|
||||
@@ -66,6 +62,7 @@ export default {
|
||||
mdn: '',
|
||||
confirmNum: '',
|
||||
// userId: '',
|
||||
oprtrId : '',
|
||||
isAuthNum: false,
|
||||
isLogin: false,
|
||||
isAuth: false,
|
||||
@@ -78,33 +75,24 @@ export default {
|
||||
tempList: []
|
||||
};
|
||||
},
|
||||
components: {
|
||||
LoginPopup : LoginPopup
|
||||
,commonModal
|
||||
components: {
|
||||
commonModal
|
||||
},
|
||||
created() {
|
||||
const historyUrl = this.$router.options.history.state.back;
|
||||
console.log(historyUrl);
|
||||
console.log('>>>>1111>>>>'+this.getLogin);
|
||||
created() {
|
||||
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) {
|
||||
this.userId = localStorage.hubwebUserId;
|
||||
this.oprtrId = localStorage.hubwebUserId;
|
||||
}
|
||||
this.isLogin = this.getLogin;
|
||||
this.pwd = this.getPwd;
|
||||
this.$store.commit("login/isLogin", false);
|
||||
|
||||
this.isLogin = this.getLogin;
|
||||
this.pwd = this.getPwd;
|
||||
this.ajaxlogin();
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
@@ -140,6 +128,36 @@ export default {
|
||||
cont.classList.remove("bg-wrap");
|
||||
},
|
||||
methods: {
|
||||
// 1차 인증
|
||||
async ajaxlogin() {
|
||||
var vm = this;
|
||||
vm.errors = null;
|
||||
|
||||
if (!this.oprtrId){
|
||||
this.$router.push({ path: '/login' });
|
||||
}
|
||||
if (!this.pwd){
|
||||
this.$router.push({ path: '/login' });
|
||||
}
|
||||
var params = {
|
||||
"oprtrId": this.oprtrId,
|
||||
"oprtrPw": this.pwd,
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await api.login(params);
|
||||
const rsp = response.data;
|
||||
if(rsp.retCode == '0000'){
|
||||
vm.$store.commit("login/isLogin", true);
|
||||
} else {
|
||||
vm.$store.commit("login/isLogin", false);
|
||||
this.$router.push({ path: '/login' });
|
||||
}
|
||||
} catch(err) {
|
||||
this.$router.push({ path: '/login' });
|
||||
}
|
||||
},
|
||||
|
||||
// 2차 인증번호 요청
|
||||
async authNum(){
|
||||
var vm = this;
|
||||
@@ -177,7 +195,6 @@ export default {
|
||||
}
|
||||
try {
|
||||
const response = await api.authNum(params)
|
||||
console.log(response);
|
||||
var rsp = response.data;
|
||||
if(rsp.retCode == '0000') {
|
||||
this.timerStop(this.timer);
|
||||
@@ -265,18 +282,14 @@ export default {
|
||||
//인증번호 확인
|
||||
try {
|
||||
const response = await api.confirmNum(params)
|
||||
const rsp = response.data;
|
||||
console.log("LOGIN ßRESUßLT_CODE : "+rsp.retCode);
|
||||
console.log(rsp);
|
||||
const rsp = response.data;
|
||||
if(rsp.retCode == '0000'){
|
||||
vm.$store.commit("login/isLogin", true);
|
||||
vm.$store.commit("login/isAuthChk", true);
|
||||
vm.$store.commit("login/userId", rsp.data.userId)
|
||||
vm.$store.commit("login/userNm", rsp.data.userNm)
|
||||
var rootUrl = rsp.data.nextUrl;
|
||||
console.log('rootUrl : '+rootUrl);
|
||||
vm.$store.commit("login/rootUrl", rsp.data.nextUrl);
|
||||
console.log(vm.$store.getters);
|
||||
vm.$router.push({ path: rootUrl});
|
||||
}else if (rsp.retCode == '4008'){
|
||||
this.row.title = '휴대폰번호 확인';
|
||||
@@ -332,11 +345,9 @@ export default {
|
||||
this.$router.push({
|
||||
path: link
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
ModalOpen: function(target){
|
||||
this.$refs.LoginPopup.ModalOpen(target);
|
||||
},
|
||||
|
||||
timerStart: function() {
|
||||
// 1초에 한번씩 start 호출
|
||||
this.timeCounter = 180;
|
||||
@@ -372,7 +383,6 @@ export default {
|
||||
);
|
||||
},
|
||||
alertCalbackFnc(callFnc){
|
||||
console.log(callFnc)
|
||||
if(callFnc === 'login'){
|
||||
this.$router.push({ path: '/'});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user