no message

main
이범준 1 year ago
parent 848677d1fa
commit b4b330a35d

@ -15,6 +15,7 @@
</div>
<div class="container-xxl container-p-y ms-1">
<h5>모바일 메시지 서비스 모듈 관련 파일 생성</h5>
<button type="button" id="btnMessageAccountValidation" class="btn btn-primary">SMS 계정 신청 검증</button>
<button type="button" id="btnMakeConfForMessage" class="btn btn-primary">설정 파일 생성</button>
<button type="button" id="btnMakeScriptForMessage" class="btn btn-primary">스크립트 파일 생성</button>
</div>
@ -56,6 +57,9 @@
});
});
$("#btnMessageAccountValidation").on("click", function(){
window.open("/resources/html/smsAccountValidation.html","sms 계정 신청 검증");
});
$("#btnMakeConfForMessage").on("click", function(){
$.ajax({

@ -0,0 +1,226 @@
<!DOCTYPE html>
<html>
<head lang="kr">
<meta charset="UTF-8">
<title>sms 계정 신청 검증</title>
</head>
<body>
<div>
<form id="frm--smsAccountValidation">
<br/>
관리아이디,연동아이디<br/>
<input type="text" id="id--smsAccountValidation" name="id" />
<button type="button" id="btnId--smsAccountValidation">확인</button>
<br/>
패스워드<br/>
<input type="text" id="pw--smsAccountValidation" name="pw" />
<button type="button" id="btnPw--smsAccountValidation">확인</button>
</form>
</div>
<script src="/webjars/3rd-party/sneat/libs/jquery/jquery.js"></script>
<script>
$("#btnId--smsAccountValidation").on("click",function(){
let str = $("#id--smsAccountValidation").val();
if(str.length < 4){
alert("4글자 이상 입력하세요.");
return;
}
if(str.length > 15){
alert("15글자 이하로 입력하세요.");
return;
}
if(containsUpperChar(str)){
alert("대문자는 사용 불가합니다.");
return;
}
if(!startLowerChar(str)){
alert("아이디는 영문소문자로 시작해야합니다.");
return;
}
let idRegex = /^[a-z0-9]{4,15}$/;
if(!idRegex.test(str)){
alert("아이디는 영문소문자와 숫자만 입력하세요.");
return;
}
if(str.indexOf("admin") != -1
|| str.indexOf("system") != -1
|| str.indexOf("main") != -1
|| str.indexOf("master") != -1){
alert("아이디에 특정 문자열(admin,system,master,main) 사용불가");
return;
}
alert("신청가능한 아이디 형식입니다. 운영지원센터에 아이디 중복여부를 문의하세요.");
});
$("#btnPw--smsAccountValidation").on("click",function(){
let str = $("#pw--smsAccountValidation").val();
if(str.length < 4){
alert("4글자 이상 입력하세요.");
return;
}
if(str.length > 15){
alert("15글자 이하로 입력하세요.");
return;
}
if(containsUpperChar(str)){
alert("대문자는 사용 불가합니다.");
return;
}
let pwRegex = /^[a-z0-9!@]{4,15}$/;
if(!pwRegex.test(str)){
alert("패스워드는 영문소문자,숫자,!,@만 입력하세요.");
return;
}
let combination = 0;
if(containsLowerChar(str)){
combination++;
}
if(containsDigit(str)){
combination++;
}
if(str.indexOf("!") != -1 || str.indexOf("@") != -1){
combination++;
}
if(combination < 2){
alert("영소문자,숫자,특수문자 중 2가지 이상 조합하세요.");
return;
}
alert("신청가능한 패스워드 형식입니다.");
});
function startLowerChar(str){
if(str.startsWith("a")
|| str.startsWith("b")
|| str.startsWith("c")
|| str.startsWith("d")
|| str.startsWith("e")
|| str.startsWith("f")
|| str.startsWith("g")
|| str.startsWith("h")
|| str.startsWith("i")
|| str.startsWith("j")
|| str.startsWith("k")
|| str.startsWith("l")
|| str.startsWith("m")
|| str.startsWith("n")
|| str.startsWith("o")
|| str.startsWith("p")
|| str.startsWith("q")
|| str.startsWith("r")
|| str.startsWith("s")
|| str.startsWith("t")
|| str.startsWith("u")
|| str.startsWith("v")
|| str.startsWith("w")
|| str.startsWith("x")
|| str.startsWith("y")
|| str.startsWith("z")
){
return true;
} else {
return false;
}
}
function containsLowerChar(str){
if(str.indexOf("a") != -1
|| str.indexOf("b") != -1
|| str.indexOf("c") != -1
|| str.indexOf("d") != -1
|| str.indexOf("e") != -1
|| str.indexOf("f") != -1
|| str.indexOf("g") != -1
|| str.indexOf("h") != -1
|| str.indexOf("i") != -1
|| str.indexOf("j") != -1
|| str.indexOf("k") != -1
|| str.indexOf("l") != -1
|| str.indexOf("m") != -1
|| str.indexOf("n") != -1
|| str.indexOf("o") != -1
|| str.indexOf("p") != -1
|| str.indexOf("q") != -1
|| str.indexOf("r") != -1
|| str.indexOf("s") != -1
|| str.indexOf("t") != -1
|| str.indexOf("u") != -1
|| str.indexOf("v") != -1
|| str.indexOf("w") != -1
|| str.indexOf("x") != -1
|| str.indexOf("y") != -1
|| str.indexOf("z") != -1
){
return true;
} else {
return false;
}
}
function containsUpperChar(str){
if(str.indexOf("A") != -1
|| str.indexOf("B") != -1
|| str.indexOf("C") != -1
|| str.indexOf("D") != -1
|| str.indexOf("E") != -1
|| str.indexOf("F") != -1
|| str.indexOf("G") != -1
|| str.indexOf("H") != -1
|| str.indexOf("I") != -1
|| str.indexOf("J") != -1
|| str.indexOf("K") != -1
|| str.indexOf("L") != -1
|| str.indexOf("M") != -1
|| str.indexOf("N") != -1
|| str.indexOf("O") != -1
|| str.indexOf("P") != -1
|| str.indexOf("Q") != -1
|| str.indexOf("R") != -1
|| str.indexOf("S") != -1
|| str.indexOf("T") != -1
|| str.indexOf("U") != -1
|| str.indexOf("V") != -1
|| str.indexOf("W") != -1
|| str.indexOf("X") != -1
|| str.indexOf("Y") != -1
|| str.indexOf("Z") != -1
){
return true;
} else {
return false;
}
}
function containsDigit(str){
if(str.indexOf("0") != -1
|| str.indexOf("1") != -1
|| str.indexOf("2") != -1
|| str.indexOf("3") != -1
|| str.indexOf("4") != -1
|| str.indexOf("5") != -1
|| str.indexOf("6") != -1
|| str.indexOf("7") != -1
|| str.indexOf("8") != -1
|| str.indexOf("9") != -1
){
return true;
} else {
return false;
}
}
</script>
</body>
</html>
Loading…
Cancel
Save