master
Hyung Geun 2022-03-11 16:27:13 +09:00
parent 4b5f5c0ad1
commit 06554b23a3
5 changed files with 69 additions and 24 deletions

View File

@ -110,7 +110,7 @@ public class CommonController {
*/
@RequestMapping(value="/userIdCheck")
@ResponseBody
public String checkId(@RequestParam("checkId")String checkId) throws Exception {
public String userIdCheck(@RequestParam("checkId")String checkId) throws Exception {
try {
int cnt = userService.selectUserIdCheck(checkId);
if(cnt > 0) {
@ -177,24 +177,19 @@ public class CommonController {
}
// 아이디 찾기 페이지 이동
@RequestMapping(value = "findId")
public String findIdView(){
return "anonymous/html/findId";
}
public String findIdView(){ return "anonymous/html/findId"; }
// 아이디 찾기 실행
@RequestMapping(value = "findId", method = RequestMethod.POST)
public String findIdAction(UserVO userVO, Model model) {
UserVO user = userService.findId(userVO);
@RequestMapping(value = "searchUserInfo")
@ResponseBody
public String searchUserInfo(UserVO userVO) {
userVO = userService.findId(userVO);
if (user == null) {
model.addAttribute("check", 1);
} else {
model.addAttribute("check", 2);
model.addAttribute("id", user.getUserid());
if (userVO == null ) {
return "userNull";
}
return "anonymous/html/findId";
return userVO.getUserid();
}
//pw찾기 페이지 이동

View File

@ -142,7 +142,10 @@
<!--아이디 비밀번호 찾기-->
<select id="findId" resultType="userVO">
select * from t_user where name=#{name} and phonenum=#{phonenum}
select userid
from t_user
where
name=#{name} and company=#{company} and email=#{email}
</select>
<select id="findPwd" resultType="userVO">

View File

@ -42,8 +42,7 @@
</tr>
</tbody>
</table>
<table class="detail_table bg-white">
<table class="detail_table">
<tbody>
<tr>
<th style="background-color: #f8f8f8" colspan="2">작업명</th>
@ -140,6 +139,7 @@
</tbody>
</table>
</div>
<c:choose>
<c:when test="${useRequestVO.status eq '99'}">
<table class="detail_table" style="margin-right: 1em">

View File

@ -3,11 +3,59 @@
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<script>
$(document).on('click', )
<script type="text/javascript">
$(document).on('click', '#checkId', function (){
checkId();
})
function checkId(){
if(inputCheck()){
$.ajax({
url: "/searchUserInfo",
type: "GET",
data: {
name: $("#username").val(),
company: $("#company").val(),
email: $("#email").val()
},
success: function (result) {
checkIdAfter(result)
},
error: function (request, status, error) {
alert("가입정보가 일치 하지 않습니다.\n 관리자에게 문의해주세요.");
}
});
}
}
function inputCheck(){
if(!$("#username").val()){
alert("이름을 입력해주세요.")
return false;
}
if(!$("#company").val()){
alert("회사명을 입력해주세요.")
return false;
}
if(!$("#email").val()){
alert("이메일을 입력해주세요.")
return false;
}
return true;
}
function checkIdAfter(result) {
if(result==="userNull"){
alert("입력된 가입 정보가 없습니다.")
}else{
alert("해당 정보로 가입된 ID는 "+result+" 입니다.")
}
}
</script>
<div class="row justify-content-end">
<div class="col-12 row m-1">
<label for="username" class="col-4 text-end">이름</label>
@ -31,9 +79,7 @@
</div>
<div class="col-8">
<button type="button" class="btn btn-primary m-3">가입정보 확인</button>
<button type="button" id="checkId" class="btn btn-primary m-3">가입정보 확인</button>
</div>
</div>

View File

@ -661,7 +661,6 @@ a {
width: 100%;
margin-top: 20px;
margin-outside: 5px;
}
.detail_table > tbody > tr > th {
@ -670,6 +669,8 @@ a {
border: 1px solid #ccc;
background-color: #f8f8f8;
padding: 10px 5px;
text-align: center;
}