수정페이지 , ,연동해제, 비밀번호초기화 폰번호없이(변경?)
통합탈퇴 ,핸드폰번호같을시 비밀번호 입력후 통합
This commit is contained in:
parent
310dbb2efe
commit
30a440997f
@ -168,8 +168,16 @@ public class OAuthLogin {
|
|||||||
user.setSnsEmail(StringUtil.getString(resNode.get("email").asText(), ""));
|
user.setSnsEmail(StringUtil.getString(resNode.get("email").asText(), ""));
|
||||||
}
|
}
|
||||||
if (resNode.has("gender"))
|
if (resNode.has("gender"))
|
||||||
|
{
|
||||||
user.setSnsGender(StringUtil.getString(resNode.get("gender").asText(), ""));
|
user.setSnsGender(StringUtil.getString(resNode.get("gender").asText(), ""));
|
||||||
|
if(user.getSnsGender().equals("male"))
|
||||||
|
{
|
||||||
|
user.setSnsGender("M");
|
||||||
|
}else if(user.getSnsGender().equals("female"))
|
||||||
|
{
|
||||||
|
user.setSnsGender("F");
|
||||||
|
}
|
||||||
|
}
|
||||||
if (resNode.has("birthday") || resNode.has("birthyear"))
|
if (resNode.has("birthday") || resNode.has("birthyear"))
|
||||||
user.setSnsUserId((resNode.get("email").asText() == null) ? "" : resNode.get("email").asText());
|
user.setSnsUserId((resNode.get("email").asText() == null) ? "" : resNode.get("email").asText());
|
||||||
|
|
||||||
|
|||||||
@ -293,17 +293,93 @@ public class MemberController extends NlibCommonController{
|
|||||||
* 동일한 핸드폰번호로 가입한 계정있을 시 통합팝업
|
* 동일한 핸드폰번호로 가입한 계정있을 시 통합팝업
|
||||||
* @exception Exception
|
* @exception Exception
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value="/member/selectAlreadySignUpMobile.do")
|
@RequestMapping(value="/member/selectAlreadySignUpMobilePopup.do")
|
||||||
public String selectAlreadySignUpMobile(NlibLoginVO vo,ModelMap model,HttpSession session,HttpServletRequest request) throws Exception{
|
public String selectAlreadySignUpMobile(NlibLoginVO vo,ModelMap model,HttpSession session,HttpServletRequest request) throws Exception{
|
||||||
List<NlibLoginVO> voList = new ArrayList<NlibLoginVO>();
|
List<NlibLoginVO> voList = new ArrayList<NlibLoginVO>();
|
||||||
// 등록된 전화번호가 있는 지 확인 (리스트)
|
// 등록된 전화번호가 있는 지 확인 (리스트)
|
||||||
voList = memberService.selectAlreadySignUpMobile(vo);
|
voList = memberService.selectAlreadySignUpMobile(vo);
|
||||||
//통합처리 url
|
|
||||||
|
//사용자ID 마스킹처리
|
||||||
|
for(int i=0;voList.size()>i;i++)
|
||||||
|
{
|
||||||
|
voList.get(i).setLoginUserId(maskingEmail(voList.get(i).getLoginUserId()));
|
||||||
|
voList.get(i).setName(maskingName(voList.get(i).getName()));
|
||||||
|
}
|
||||||
|
|
||||||
model.addAttribute("cnt",voList.size());
|
model.addAttribute("cnt",voList.size());
|
||||||
model.addAttribute("result",voList);
|
model.addAttribute("result",voList);
|
||||||
return "nlib/member/alreadySignUp";
|
return "nlib/member/alreadySignUpPopup";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 회원가입시 기존계정과 핸드폰번호가 일치할시 sns 계정통합
|
||||||
|
* @exception Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/member/snsAccountLink.ajax" , method=RequestMethod.POST)
|
||||||
|
public @ResponseBody String snsAccountLink(NlibLoginVO vo,HttpServletResponse response,Authentication authentication,HttpServletRequest request,HttpSession session) throws Exception{
|
||||||
|
NlibLoginVO loginVO = new NlibLoginVO();
|
||||||
|
loginVO.setMbInfoId(vo.getMbInfoId());
|
||||||
|
|
||||||
|
//사용자 정보를 가져온다.
|
||||||
|
loginVO=userInfoService.selectMyInfo(loginVO);
|
||||||
|
|
||||||
|
String msg="";
|
||||||
|
|
||||||
|
String encodedText=null;
|
||||||
|
encodedText = egovPasswordEncoder.encryptPassword(loginVO.getLoginUserId()+vo.getPassword());
|
||||||
|
vo.setPassword(encodedText);
|
||||||
|
|
||||||
|
//암호화된 패스워드 비교
|
||||||
|
if(loginVO.getPassword().equals(vo.getPassword())) {
|
||||||
|
String jsessionId = session.getId();
|
||||||
|
OAuthUniversalUser oauthUser = SessionConfig.getNewMemberInfo(jsessionId);
|
||||||
|
oauthUser.setMbInfoId(vo.getMbInfoId());
|
||||||
|
memberService.insertMemberSns(oauthUser);
|
||||||
|
msg="link";
|
||||||
|
}else {
|
||||||
|
msg="mismatch";
|
||||||
|
}
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 계정통합후 로그인
|
||||||
|
* @exception Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/member/snsAccountLinkLogin.do")
|
||||||
|
public String snsAccountLinkLogin(NlibLoginVO vo,ModelMap model,HttpSession session,HttpServletRequest request) throws Exception{
|
||||||
|
String redirectUrl="";
|
||||||
|
|
||||||
|
String url = request.getRequestURL().toString();
|
||||||
|
String councilHomeUrl=url.replaceAll(request.getRequestURI(), "") + request.getContextPath();
|
||||||
|
|
||||||
|
String jsessionId = session.getId();
|
||||||
|
OAuthUniversalUser oauthUser = SessionConfig.getNewMemberInfo(jsessionId);
|
||||||
|
|
||||||
|
SessionConfig.setLoginInfo(jsessionId, oauthUser);
|
||||||
|
session.setAttribute("councilReturnUrl","/member/accountConsolidationForm.do" );//로그인후 이동할페이지
|
||||||
|
redirectUrl = councilHomeUrl + NlibProperty.getString("nculture.login.post.login.redirect.uri");
|
||||||
|
|
||||||
|
return "redirect:" + redirectUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 계정통합 결과폼
|
||||||
|
* @exception Exception
|
||||||
|
*/
|
||||||
|
@RequestMapping(value="/member/accountConsolidationForm.do")
|
||||||
|
public String accountConsolidationForm(NlibLoginVO vo,ModelMap model,Authentication authentication,HttpSession session,HttpServletRequest request) throws Exception{
|
||||||
|
//사용자 정보를 가져온다.
|
||||||
|
NlibLoginVO loginVO = getNlibLoginVO(authentication);
|
||||||
|
loginVO.setJoinCouncilCd(getCurCouncilCd(request));
|
||||||
|
|
||||||
|
loginVO = loginService.selectLoginUserInfo(loginVO);
|
||||||
|
loginVO.setLoginUserId(maskingEmail(loginVO.getLoginUserId()));
|
||||||
|
loginVO.setName(maskingName(loginVO.getName()));
|
||||||
|
|
||||||
|
model.addAttribute("result",loginVO);
|
||||||
|
return "/nlib/member/accountConsolidationForm";
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 회원가입
|
* 회원가입
|
||||||
* @exception Exception
|
* @exception Exception
|
||||||
@ -565,8 +641,12 @@ public class MemberController extends NlibCommonController{
|
|||||||
public String deleteMembershipForm(HttpServletResponse response,Authentication authentication,HttpServletRequest request,ModelMap model) throws Exception{
|
public String deleteMembershipForm(HttpServletResponse response,Authentication authentication,HttpServletRequest request,ModelMap model) throws Exception{
|
||||||
//사용자 정보를 가져온다.
|
//사용자 정보를 가져온다.
|
||||||
NlibLoginVO loginVO = getNlibLoginVO(authentication);
|
NlibLoginVO loginVO = getNlibLoginVO(authentication);
|
||||||
//이메일 마스킹
|
loginVO.setJoinCouncilCd(getCurCouncilCd(request));
|
||||||
|
|
||||||
|
loginVO = loginService.selectLoginUserInfo(loginVO);
|
||||||
|
//이메일,이름 마스킹
|
||||||
loginVO.setLoginUserId(maskingEmail(loginVO.getLoginUserId()));
|
loginVO.setLoginUserId(maskingEmail(loginVO.getLoginUserId()));
|
||||||
|
loginVO.setName(maskingName(loginVO.getName()));
|
||||||
model.addAttribute("loginVO",loginVO);
|
model.addAttribute("loginVO",loginVO);
|
||||||
return "nlib/member/deleteMembershipForm";
|
return "nlib/member/deleteMembershipForm";
|
||||||
}
|
}
|
||||||
@ -716,7 +796,7 @@ public class MemberController extends NlibCommonController{
|
|||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** * 이메일 masking 후 리턴<br> * 변환 실패시 입력값 그대로 리턴<br> * 이메일 아이디 앞 2자리 노출<br> * 마스킹 처리는 글자수 상관없이 5자리로 노출 * */
|
/** * 이메일 masking 후 리턴<br> * 변환 실패시 입력값 그대로 리턴<br> * 이메일 아이디 앞 2자리 노출<br> */
|
||||||
public String maskingEmail(String email){
|
public String maskingEmail(String email){
|
||||||
try{
|
try{
|
||||||
if(StringUtils.isEmpty(email) || !email.contains("@")){
|
if(StringUtils.isEmpty(email) || !email.contains("@")){
|
||||||
@ -741,6 +821,26 @@ public class MemberController extends NlibCommonController{
|
|||||||
catch (Exception e){
|
catch (Exception e){
|
||||||
} return email;
|
} return email;
|
||||||
}
|
}
|
||||||
|
/** * 이름 masking 후 리턴<br> * 변환 실패시 입력값 그대로 리턴<br>*/
|
||||||
|
public String maskingName(String name){
|
||||||
|
try{
|
||||||
|
if(StringUtils.isEmpty(name)){
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
if(name.length() == 2){
|
||||||
|
|
||||||
|
return name.substring(0, 1)+"*";
|
||||||
|
}
|
||||||
|
else if(name.length() >2){
|
||||||
|
String str="";
|
||||||
|
for(int i = 2; name.length()>i;i++)
|
||||||
|
str+="*";
|
||||||
|
return name.substring(0, 1)+str+name.substring(name.length()-1,name.length());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e){
|
||||||
|
} return name;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 회원가입 SNS 구글인증
|
* 회원가입 SNS 구글인증
|
||||||
* @exception Exception
|
* @exception Exception
|
||||||
|
|||||||
@ -118,6 +118,8 @@
|
|||||||
MB_INFO_ID
|
MB_INFO_ID
|
||||||
,LOGIN_USER_ID
|
,LOGIN_USER_ID
|
||||||
,EMAIL
|
,EMAIL
|
||||||
|
,PASSWORD
|
||||||
|
,NAME
|
||||||
FROM
|
FROM
|
||||||
MB_INFO
|
MB_INFO
|
||||||
WHERE 1=1
|
WHERE 1=1
|
||||||
|
|||||||
@ -55,11 +55,19 @@
|
|||||||
MB_INFO_ID
|
MB_INFO_ID
|
||||||
,LOGIN_USER_ID
|
,LOGIN_USER_ID
|
||||||
,MOBILE_NO
|
,MOBILE_NO
|
||||||
|
,PASSWORD
|
||||||
FROM
|
FROM
|
||||||
MB_INFO
|
MB_INFO
|
||||||
WHERE 1=1
|
WHERE 1=1
|
||||||
AND MOBILE_NO = #{mobileNo}
|
<if test='mbInfoId != null and mbInfoId != ""'>
|
||||||
AND LOGIN_USER_ID = #{loginUserId}
|
AND MB_INFO_ID = #{mbInfoId};
|
||||||
|
</if>
|
||||||
|
<if test='mobileNo != null and mobileNo != ""'>
|
||||||
|
AND MOBILE_NO = #{mobileNo};
|
||||||
|
</if>
|
||||||
|
<if test='loginUserId != null and loginUserId != ""'>
|
||||||
|
AND LOGIN_USER_ID = #{loginUserId};
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 내 정보 수정 -->
|
<!-- 내 정보 수정 -->
|
||||||
|
|||||||
@ -36,6 +36,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>계정이 통합되었습니다.</h1>
|
<h1>계정이 통합되었습니다.</h1>
|
||||||
|
${result.name } ${result.loginUserId }
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@ -1,40 +0,0 @@
|
|||||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
|
||||||
pageEncoding="UTF-8"%>
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
||||||
<title>Insert title here</title>
|
|
||||||
<script>
|
|
||||||
function notAlreadySingUp()
|
|
||||||
{
|
|
||||||
window.close();
|
|
||||||
}
|
|
||||||
$(document).ready(function(){
|
|
||||||
if(${cnt} > 0) {
|
|
||||||
fn_showLayerPop();
|
|
||||||
} else {
|
|
||||||
window.close();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<form id="alreadySingUpForm" name="alreadySingUpForm" action="${pageContext.request.contextPath}/member/insertMemberInfo.do">
|
|
||||||
<p1>서비스에 이미 가입된 계정이 있습니다.</p1>
|
|
||||||
<table>
|
|
||||||
<c:forEach items="${result}" var="result">
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<td><c:out value="${result.mbInfoId}"/></td>
|
|
||||||
<td><c:out value="${result.loginUserId}"/></td>
|
|
||||||
</tr>
|
|
||||||
</c:forEach>
|
|
||||||
</table>
|
|
||||||
<a onclick="notAlreadySingUp();">아니요, 내가 아닙니다.</a>
|
|
||||||
</form>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
102
src/main/webapp/WEB-INF/jsp/nlib/member/alreadySignUpPopup.jsp
Normal file
102
src/main/webapp/WEB-INF/jsp/nlib/member/alreadySignUpPopup.jsp
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||||
|
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %>
|
||||||
|
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
||||||
|
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<title>Insert title here</title>
|
||||||
|
<script>
|
||||||
|
function notAlreadySingUp()
|
||||||
|
{
|
||||||
|
window.close();
|
||||||
|
}
|
||||||
|
$(document).ready(function(){
|
||||||
|
var cnt=${cnt};
|
||||||
|
|
||||||
|
if(cnt > 0) {
|
||||||
|
fn_showLayerPop();
|
||||||
|
} else {
|
||||||
|
window.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function selectAccount(mbInfoId,name,loginUserId)
|
||||||
|
{
|
||||||
|
$("#alreadySingUpForm").css("display","none");
|
||||||
|
$("#mbInfoId").val(mbInfoId);
|
||||||
|
$("#selectName").val(name);
|
||||||
|
$("#selectLoginUserId").val(loginUserId);
|
||||||
|
$("#selectAccountForm").css("display","block");
|
||||||
|
}
|
||||||
|
function goPrevious()
|
||||||
|
{
|
||||||
|
$("#selectAccountForm").css("display","none");
|
||||||
|
$("#alreadySingUpForm").css("display","block");
|
||||||
|
}
|
||||||
|
|
||||||
|
function accountLink()
|
||||||
|
{
|
||||||
|
password=$("#selectPassword").val();
|
||||||
|
console.log(password);
|
||||||
|
if(password == "")
|
||||||
|
{
|
||||||
|
alert("비밀번호 입력이 필요합니다.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url : "${pageContext.request.contextPath}/member/snsAccountLink.ajax",
|
||||||
|
type : "POST",
|
||||||
|
async: false,
|
||||||
|
data : {"mbInfoId":$("#mbInfoId").val(),
|
||||||
|
"password":password
|
||||||
|
},
|
||||||
|
success : function(result){
|
||||||
|
if(result=="link")
|
||||||
|
{
|
||||||
|
alert("계정이 통합되었습니다.");
|
||||||
|
location.href="${pageContext.request.contextPath}/member/snsAccountLinkLogin.do"
|
||||||
|
}else if(result=="mismatch")
|
||||||
|
{
|
||||||
|
alert("올바르지 않은 비밀번호입니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
},error : function(){
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="alreadySingUpForm" name="alreadySingUpForm">
|
||||||
|
<p1>서비스에 이미 가입된 계정이 있습니다.</p1>
|
||||||
|
<table>
|
||||||
|
<c:forEach items="${result}" var="result" varStatus="status">
|
||||||
|
|
||||||
|
<tr onClick="selectAccount('<c:out value="${result.mbInfoId}"/>','<c:out value="${result.name}"/>','<c:out value="${result.loginUserId}"/>');">
|
||||||
|
<td><c:out value="${result.name}"/></td>
|
||||||
|
<td><c:out value="${result.loginUserId}"/></td>
|
||||||
|
</tr>
|
||||||
|
</c:forEach>
|
||||||
|
</table>
|
||||||
|
<a href="javascript:void(0);" onclick="fn_closeLayerPopup();">아니요, 내가 아닙니다.</a>
|
||||||
|
</form>
|
||||||
|
<form id="selectAccountForm" name="selectAccountForm" style="display:none;">
|
||||||
|
<p1>비밀번호 입력</p1>
|
||||||
|
<div id="accountInfo">
|
||||||
|
<input type="text" id="selectName" name="selectName" readonly><input type="text" id="selectLoginUserId" name="selectLoginUserId" readonly>
|
||||||
|
</div>
|
||||||
|
<input type="password" id="selectPassword" name="selectPassword" placeholder="비밀번호"><br>
|
||||||
|
<a href="javascript:notAlreadySingUp();" onclick="return false;">비밀번호를 잊으셨나요?</a>
|
||||||
|
<input type="button" onclick="goPrevious();" value="이전으로"><input type="button" onclick="accountLink();" value="계정 연결하기">
|
||||||
|
<input type="hidden" id="mbInfoId" name="mbInfoId">
|
||||||
|
</form>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -246,8 +246,8 @@ function certMobileCheck(){
|
|||||||
{
|
{
|
||||||
alert("인증되었습니다.");
|
alert("인증되었습니다.");
|
||||||
$("#mobileCertYn").val("Y");
|
$("#mobileCertYn").val("Y");
|
||||||
document.joinForm.action="/nlib/member/selectAlreadySignUpMobile.do";
|
document.joinForm.action="/nlib/member/selectAlreadySignUpMobilePopup.do";
|
||||||
fn_layerPopFormSubmit(document.joinForm,false);
|
fn_layerPopFormSubmit("joinForm",false);
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
alert("인증번호가 일치하지않습니다.");
|
alert("인증번호가 일치하지않습니다.");
|
||||||
@ -436,7 +436,7 @@ label.error {
|
|||||||
<tr>
|
<tr>
|
||||||
<td id="title">이름</td>
|
<td id="title">이름</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" id="name" name="name" maxlength="20" value="<c:out value="${loginVO.snsName}"/>" required >
|
<input type="text" id="name" name="name" minlength="2" maxlength="20" value="<c:out value="${loginVO.snsName}"/>" required >
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@ -427,7 +427,7 @@ label.error {
|
|||||||
<tr>
|
<tr>
|
||||||
<td id="title">이름</td>
|
<td id="title">이름</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" id="name" name="name" maxlength="20" required value=<c:out value="${loginVO.name}"/>>
|
<input type="text" id="name" name="name" minlength="2" maxlength="20" required value=<c:out value="${loginVO.name}"/>>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user