로그인 관련 / 메뉴 링크 추가 / 홈페이지 로그인 적용

This commit is contained in:
kimre
2022-07-08 14:07:33 +09:00
parent 3d05b45299
commit b2ff509948
73 changed files with 1251 additions and 668 deletions

View File

@@ -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 = '휴대폰번호 확인';