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

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

@@ -27,10 +27,10 @@
<tbody>
<tr v-for="(option, i) in list" v-bind:key="i">
<td>{{ option.lmtYm }}</td>
<td>{{ option.startAmount }}</td>
<td>{{ option.useAmount }}</td>
<td>{{ option.krrrAmount }}</td>
<td>{{ option.extshAmount }}</td>
<td>{{ option.startAmount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ option.useAmount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ option.krrrAmount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
<td>{{ option.extshAmount.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') }}</td>
</tr>
<tr v-if="list.length === 0">
<td colspan="5">검색 결과가 없습니다.</td>

View File

@@ -19,14 +19,6 @@
<th>ID</th>
<td><input type="text" v-model.trim="userId" ref="_userId"></td>
</tr>
<tr>
<th>비밀번호</th>
<td><input type="password" @keypress="onlyPassword" @input="onlyPassword" required minlength="8" maxlength="16" ref="_pwd1" v-model.trim="userPwd1"></td>
</tr>
<tr>
<th>비밀번호 확인</th>
<td><input type="password" @keypress="onlyPassword" @input="onlyPassword" required minlength="8" maxlength="16" ref="_pwd2" v-model.trim="userPwd2"></td>
</tr>
<tr>
<th>이름</th>
<td><input type="text" v-model.trim="userNm" ref="_userNm"></td>
@@ -104,8 +96,6 @@ export default {
stat: "",
userId:"",
userNm:"",
userPwd1:"",
userPwd2:"",
code:"",
userTotalCnt:0,
}
@@ -133,7 +123,6 @@ export default {
async memberInsert(){
this.row.adminId = this.adminId;
this.row.userId = this.userId;
this.row.userPw = this.userPwd1;
this.row.userNm = this.userNm;
this.row.userEmail = this.email;
this.row.mdn = this.mdn;
@@ -185,43 +174,6 @@ export default {
// Object.assign(this.$data, this.$options.data());
// this.adminId = targetAdminId;
// },
doPwdValidate(){
if(this.isNull(this.userPwd2)){
this.row.title = '청약고객관리';
this.row.msg1 = '비밀번호 확인을 입력해 주세요.';
this.$refs.commmonModal.alertModalOpen(this.row);
this.$refs._pwd2.focus();
return false;
}
if(!lodash.isEqual(this.userPwd1, this.userPwd2)){
this.row.title = '청약고객관리';
this.row.msg1 = '비밀번호가 일치하지 않습니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
this.$refs._pwd2.focus();
return false;
}
const pwdLen = this.bytes(this.userPwd1);
if(!(pwdLen >= 8 && pwdLen <= 16)){
this.row.title = '청약고객관리';
this.row.msg1 = '비밀번호는 8~16자의 영문, 숫자, 특수문자(!,@, $, %, ^, &, *) 조합이 필요합니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
this.$refs._pwd1.focus();
return false;
}
const pEng = /[A-Za-z]/g; // 영문자
const pNum = /[0-9]/g; // 숫자
const pSpc = /[!@$%^&*]/g; // 특수문자
if(!(pEng.test(this.userPwd1) && pNum.test(this.userPwd1) && pSpc.test(this.userPwd1))) {
this.row.title = '청약고객관리';
this.row.msg1 = '비밀번호는 8~16자의 영문, 숫자, 특수문자(!,@, $, %, ^, &, *) 조합이 필요합니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
this.$refs._pwd1.focus();
return false;
}
return true;
},
doValidate(){
if(this.userTotalCnt >= 100){
// 사용자등록제한_최대100개까지
@@ -237,28 +189,6 @@ export default {
return false;
}
if(this.isNull(this.userPwd1)){
this.row.title = '청약고객관리';
this.row.msg1 = '비밀번호를 입력해 주세요.';
this.$refs.commmonModal.alertModalOpen(this.row);
this.$refs.__pwd1.focus();
return false;
}
if(this.isNull(this.userPwd2)){
this.row.title = '청약고객관리';
this.row.msg1 = '비밀번호 확인을 입력해 주세요.';
this.$refs.commmonModal.alertModalOpen(this.row);
this.$refs.__pwd2.focus();
return false;
}
if(!this.isNull(this.userPwd1)){
if(!this.doPwdValidate()){
return false;
}
}
if(this.isNull(this.userNm)){
this.row.title = '청약고객관리';
this.row.msg1 = '이름을 입력해 주세요.';

View File

@@ -7,7 +7,13 @@
</div>
<div class="table table_form">
<form autocomplete="off">
<form action=""
target="_blank"
method="post"
ref="form">
<input type="hidden" name="svcUserId" id="svcUserId" v-model="svcUserId"/>
<input type="hidden" name="ezSvcUserAuthKey" id="ezSvcUserAuthKey" v-model="ezSvcUserAuthKey"/>
</form>
<table>
<colgroup>
<col style="width:140px">
@@ -32,7 +38,7 @@
<th>ID</th>
<td colspan="2">
{{userId}}
<button type="button" class="button grey btn-a">로그인</button>
<button type="button" class="button grey btn-a" @click="homeLogin">로그인</button>
</td>
<th class="center">관리자명</th>
<td colspan="2">{{adminId}} / {{adminNm}}</td>
@@ -81,7 +87,7 @@
</tr>
</tbody>
</table>
</form>
</div>
<div>
@@ -149,7 +155,6 @@
</div>
</div>
</template>
<script>
@@ -188,7 +193,8 @@ export default {
email: '',
userTotalCnt:0,
selected: [],
svcUserId:'',
ezSvcUserAuthKey:''
}
},
props: {
@@ -206,8 +212,6 @@ export default {
},
created(){
this.memberDetail(this.$route.params.serviceId);
this.$store.commit("login/isLogin", true);
this.$store.commit("login/isAuthChk", true);
},
destroyed() {
this.$store.commit('searchcondition/updateSearchCondition', {
@@ -243,138 +247,145 @@ export default {
},
},
methods: {
valAlert(props){
valAlert(props){
//alert("호출됨!");
this.$refs.commmonModal.alertModalOpen(props);
},
valConfirm(props){
this.$refs.commmonModal.confirmModalOpen(props);
},
async memberDetail(serviceId){
this.row.userId = serviceId;
try {
const response = await custMgtApi.memberAdminDetail(this.row);
const result = response.data;
if (result != null && result.retCode == "0000") {
this.formReset();
this.userNm = result.data.userNm;
this.userId = result.data.userId;
this.regDt = result.data.regDt;
this.userType = result.data.userType;
this.adminId = result.data.adminId;
this.adminNm = result.data.adminNm;
this.sendingLimit = result.data.sendingLimit;
this.lineType = result.data.lineType;
this.userStat = result.data.userStat;
this.lastLoginDt = result.data.lastLoginDt;
this.memo = result.data.memo;
this.mdn = result.data.mdn;
this.email = result.data.email;
this.list = result.data.list;
this.userTotalCnt = result.data.list.length;
console.log('userTotalCnt:'+result.data.list.length);
this.totalItems = result.data.paging.totalCnt;
}
} catch (error) {
console.log(error);
this.row.title = '청약고객관리';
this.row.msg1 = '실패 하였습니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
}
},
async updateAdminInfoTotal(){
this.row.userId = this.adminId;
this.row.sendingLimit = this.sendingLimit;
this.row.lineType = this.lineType;
this.row.userStat = this.userStat;
this.row.memo = this.memo;
console.log(this.row);
try {
const response = await custMgtApi.updateAdminInfoTotal(this.row);
const result = response.data;
if (result != null && result.retCode == "0000") {
this.row.title = '청약고객관리';
this.row.msg1 = '저장 하였습니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
}else if(result != null && result.retCode == "4019"){
this.row.title = '청약고객관리';
this.row.msg1 = '발송한도금액이 정액한도금액보다 작습니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
}else {
valConfirm(props){
this.$refs.commmonModal.confirmModalOpen(props);
},
async memberDetail(serviceId){
this.row.userId = serviceId;
try {
const response = await custMgtApi.memberAdminDetail(this.row);
const result = response.data;
if (result != null && result.retCode == "0000") {
this.formReset();
this.userNm = result.data.userNm;
this.userId = result.data.userId;
this.regDt = result.data.regDt;
this.userType = result.data.userType;
this.adminId = result.data.adminId;
this.adminNm = result.data.adminNm;
this.sendingLimit = result.data.sendingLimit.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
this.lineType = result.data.lineType;
this.userStat = result.data.userStat;
this.lastLoginDt = result.data.lastLoginDt;
this.memo = result.data.memo;
this.mdn = result.data.mdn;
this.email = result.data.email;
this.list = result.data.list;
this.userTotalCnt = result.data.list.length;
console.log('userTotalCnt:'+result.data.list.length);
this.totalItems = result.data.paging.totalCnt;
}
} catch (error) {
console.log(error);
this.row.title = '청약고객관리';
this.row.msg1 = '실패 하였습니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
}
} catch (error) {
console.log(error);
this.row.title = '청약고객관리';
this.row.msg1 = '실패 하였습니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
}
}
},
// 저장 후 부모창 호출.
toComplete(){
this.$router.push({ name: 'memberList', params: this.row });
},
excelPopOpen() {
console.log(this.adminId);
this.$refs.memberBulkRegPop.excelPopOpen(this.adminId, this.totalItems);
},
memberUpdatePopOpen(target) {
this.row.userId = target;
this.row.adminId = this.adminId;
this.$refs.memberModifyPop.memberUpdateModalOpen(this.row);
},
memberInsertPopOpen() {
this.row.adminId = this.adminId;
this.row.userTotalCnt = this.userTotalCnt;
this.$refs.memberRegPop.memberInsertModalOpen(this.row);
},
memoTotalPopOpen(){
this.row.adminId = this.adminId;
this.$refs.memoTatalListPop.memoTotalModalOpen(this.row);
},
async memberDelete(){
async updateAdminInfoTotal(){
this.row.userId = this.adminId;
this.row.sendingLimit = this.sendingLimit;
this.row.lineType = this.lineType;
this.row.userStat = this.userStat;
this.row.memo = this.memo;
console.log(this.row);
try {
const response = await custMgtApi.updateAdminInfoTotal(this.row);
const result = response.data;
if (result != null && result.retCode == "0000") {
if(window.confirm('삭제 하시겠습니까?')){
var serviceId = this.adminId;
this.row.list = this.selected.map((row)=>({userId:row}));
this.row.adminId = this.adminId;
console.log(this.row);
try {
let response = await custMgtApi.deleteUser(this.row);
const result = response.data;
if (result != null && result.retCode == "0000") {
this.row.title = '청약고객관리';
this.row.msg1 = '저장 하였습니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
this.memberDetail(serviceId);
}
} catch (error) {
console.log(error);
}else if(result != null && result.retCode == "4019"){
this.row.title = '청약고객관리';
this.row.msg1 = '발송한도금액이 정액한도금액보다 작습니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
}else {
this.row.title = '청약고객관리';
this.row.msg1 = '실패 하였습니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
}
} catch (error) {
console.log(error);
this.row.title = '청약고객관리';
this.row.msg1 = '실패 하였습니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
}
}
},
setAuthData() {
// 권한 옵션.
api.commAuth().then(response => {
this.authType = response.data.data.list;
});
},
formReset(){
Object.assign(this.$data, this.$options.data());
},
}
},
// 저장 후 부모창 호출.
toComplete(){
this.$router.push({ name: 'memberList', params: this.row });
},
excelPopOpen() {
console.log(this.adminId);
this.$refs.memberBulkRegPop.excelPopOpen(this.adminId, this.totalItems);
},
memberUpdatePopOpen(target) {
this.row.userId = target;
this.row.adminId = this.adminId;
this.$refs.memberModifyPop.memberUpdateModalOpen(this.row);
},
memberInsertPopOpen() {
this.row.adminId = this.adminId;
this.row.userTotalCnt = this.userTotalCnt;
this.$refs.memberRegPop.memberInsertModalOpen(this.row);
},
memoTotalPopOpen(){
this.row.adminId = this.adminId;
this.$refs.memoTatalListPop.memoTotalModalOpen(this.row);
},
async memberDelete(){
if(window.confirm('삭제 하시겠습니까?')){
var serviceId = this.adminId;
this.row.list = this.selected.map((row)=>({userId:row}));
this.row.adminId = this.adminId;
console.log(this.row);
try {
let response = await custMgtApi.deleteUser(this.row);
const result = response.data;
if (result != null && result.retCode == "0000") {
this.row.title = '청약고객관리';
this.row.msg1 = '저장 하였습니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
this.memberDetail(serviceId);
}
} catch (error) {
console.log(error);
this.row.title = '청약고객관리';
this.row.msg1 = '실패 하였습니다.';
this.$refs.commmonModal.alertModalOpen(this.row);
}
}
},
setAuthData() {
// 권한 옵션.
api.commAuth().then(response => {
this.authType = response.data.data.list;
});
},
formReset(){
Object.assign(this.$data, this.$options.data());
},
homeLogin(){
console.log(process.env.VUE_APP_HOME_PAGE_URL)
console.log(process.env.VUE_APP_AUTHKEY)
this.$refs.form.action = process.env.VUE_APP_HOME_PAGE_URL
this.svcUserId = this.userId
this.ezSvcUserAuthKey = process.env.VUE_APP_AUTHKEY
this.$refs.form.submit()
},
},
};

View File

@@ -7,7 +7,13 @@
</div>
<div class="table table_form">
<form autocomplete="off">
<form action=""
target="_blank"
method="post"
ref="form">
<input type="hidden" name="svcUserId" id="svcUserId" v-model="svcUserId"/>
<input type="hidden" name="ezSvcUserAuthKey" id="ezSvcUserAuthKey" v-model="ezSvcUserAuthKey"/>
</form>
<table>
<colgroup>
<col style="width:140px">
@@ -34,7 +40,7 @@
<th>ID</th>
<td colspan="2">
{{userId}}
<button type="button" class="button grey btn-a">로그인</button>
<button type="button" class="button grey btn-a" @click="homeLogin">로그인</button>
</td>
<th class="center">구분</th>
<td colspan="2">{{userType}}</td>
@@ -62,7 +68,6 @@
</tr>
</tbody>
</table>
</form>
</div>
<div class="pop-btn2">
@@ -112,6 +117,8 @@ export default {
mdn : '',
email: '',
stat:'',
svcUserId:'',
ezSvcUserAuthKey:''
}
},
@@ -127,8 +134,6 @@ export default {
},
created(){
this.memberDetail(this.$route.params.serviceId);
this.$store.commit("login/isLogin", true);
this.$store.commit("login/isAuthChk", true);
},
destroyed() {
@@ -266,6 +271,14 @@ export default {
//this.email = '';
this.$refs._email.focus();
},
homeLogin(){
console.log(process.env.VUE_APP_HOME_PAGE_URL)
console.log(process.env.VUE_APP_AUTHKEY)
this.$refs.form.action = process.env.VUE_APP_HOME_PAGE_URL
this.svcUserId = this.userId
this.ezSvcUserAuthKey = process.env.VUE_APP_AUTHKEY
this.$refs.form.submit()
},
},
};
</script>

View File

@@ -210,8 +210,6 @@ export default {
vuejsDatepicker,
},
created(){
this.$store.commit("login/isLogin", true);
this.$store.commit("login/isAuthChk", true);
this.setCodeData();
this.setPeriodDay(0);
},
@@ -249,10 +247,24 @@ export default {
}
this.search(isKeep);
},
beforeRouteLeave(to, from, next) {
const getP = this.$refs.table.getPagination();
console.log("==========getP : " + getP._currentPage);
this.$store.commit('searchcondition/updateSearchCondition', {
page: getP._currentPage,
perPage: this.perPageCnt,
params: this.grid.params
});
// 라우트 하기전 실행
next();
},
methods: {
search: function(isKeep) {
this.grid.params.startDt = moment(this.startDate).format('YYYYMMDD');
this.grid.params.endDt = moment(this.endDate).format('YYYYMMDD');
console.log('this.perPageCnt'+this.perPageCnt);
//console.log(this.grid.params);
console.log(this.grid.params);
this.$refs.table.search(this.grid.params, isKeep);
this.sendStoreData();
},
@@ -302,9 +314,10 @@ export default {
setPeriodDay(day) {
this.periodDay = day;
this.endDate = new Date();
this.startDate = moment(this.endDate)
.subtract(day, 'day')
.toDate();
//this.startDate = moment(this.endDate)
// .subtract(day, 'day')
// .toDate();
this.initSetStartDate();
this.closeDate('start');
this.closeDate('end');
@@ -345,18 +358,14 @@ export default {
return moment(date).format('YYYY-MM-DD');
}
},
initSetStartDate(){
let setYear = Number(moment(new Date()).format('YYYY'));
let initStartDate = new Date(setYear, 0, 1);
this.startDate = initStartDate;
console.log(moment(this.startDate).format('YYYY-MM-DD'));
},
},
beforeRouteLeave(to, from, next) {
const getP = this.$refs.table.getPagination();
console.log("==========getP : " + getP._currentPage);
this.$store.commit('searchcondition/updateSearchCondition', {
page: getP._currentPage,
perPage: this.perPageCnt,
params: this.grid.params
});
// 라우트 하기전 실행
next();
},
};
</script>

View File

@@ -239,8 +239,6 @@ export default {
commonModal,
},
created(){
this.$store.commit("login/isLogin", true);
this.$store.commit("login/isAuthChk", true);
console.log(this.$route.params.serviceId);
this.subsDetail(this.$route.params.serviceId);
// checkVaildBizNum

View File

@@ -219,13 +219,25 @@ export default {
vuejsDatepicker,
},
created(){
this.$store.commit("login/isLogin", true);
this.$store.commit("login/isAuthChk", true);
this.setCodeData();
this.getExcelHeader();
this.setPeriodDay(0);
},
destroyed() {
this.$store.commit('searchcondition/updateSearchCondition', {
page: 1,
perPage: 50,
params: {
searchType1: '',
searchType2: '',
searchType3: '',
searchText1: '',
startDt: '',
endDt: ''
}
});
},
mounted() {
@@ -260,8 +272,10 @@ export default {
},
methods: {
search: function(isKeep) {
this.grid.params.startDt = moment(this.startDate).format('YYYYMMDD');
this.grid.params.endDt = moment(this.endDate).format('YYYYMMDD');
console.log('this.perPageCnt'+this.perPageCnt);
//console.log(this.grid.params);
console.log(this.grid.params);
this.$refs.table.search(this.grid.params, isKeep);
this.sendStoreData();
},
@@ -351,9 +365,10 @@ export default {
setPeriodDay(day) {
this.periodDay = day;
this.endDate = new Date();
this.startDate = moment(this.endDate)
.subtract(day, 'day')
.toDate();
// this.startDate = moment(this.endDate)
// .subtract(day, 'day')
// .toDate();
this.initSetStartDate();
this.closeDate('start');
this.closeDate('end');
@@ -394,6 +409,12 @@ export default {
return moment(date).format('YYYY-MM-DD');
}
},
initSetStartDate(){
let setYear = Number(moment(new Date()).format('YYYY'));
let initStartDate = new Date(setYear, 0, 1);
this.startDate = initStartDate;
console.log(moment(this.startDate).format('YYYY-MM-DD'));
},
},
};
</script>