회원가입폼 처리 진행중 커밋
This commit is contained in:
parent
bfe6185831
commit
98b266c828
@ -1,6 +1,10 @@
|
||||
|
||||
package nlib.user.service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.ext.oauth.service.OAuthUniversalUser;
|
||||
import nlib.restful.service.DataApiReqVO;
|
||||
import nlib.restful.service.DataApiResVO;
|
||||
|
||||
@ -47,5 +51,11 @@ public interface MemberService
|
||||
|
||||
public String createInitPwd();
|
||||
|
||||
public String selectAlreadySignUpId(OAuthUniversalUser oauthUser) throws Exception;
|
||||
|
||||
public void insertMemberSns(OAuthUniversalUser oauthUser);
|
||||
|
||||
public List<NlibLoginVO> selectAlreadySignUpMobile(NlibLoginVO loginVO) throws Exception;
|
||||
|
||||
|
||||
}
|
||||
@ -1,8 +1,12 @@
|
||||
|
||||
package nlib.user.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import egovframework.com.ext.oauth.service.OAuthUniversalUser;
|
||||
import egovframework.rte.psl.dataaccess.mapper.Mapper;
|
||||
import nlib.restful.service.DataApiReqVO;
|
||||
import nlib.restful.service.DataApiResVO;
|
||||
@ -31,5 +35,9 @@ public interface MemberDAO
|
||||
|
||||
public DataApiResVO leaveMember(DataApiReqVO reqVO) throws Exception;
|
||||
|
||||
public void insertMemberSns(OAuthUniversalUser oauthUser);
|
||||
|
||||
public String selectAlreadySignUpId(OAuthUniversalUser oauthUser) throws Exception;
|
||||
|
||||
public List<NlibLoginVO> selectAlreadySignUpMobile(NlibLoginVO loginVO) throws Exception;
|
||||
}
|
||||
@ -3,6 +3,7 @@ package nlib.user.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@ -10,11 +11,14 @@ import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.com.ext.oauth.service.OAuthUniversalUser;
|
||||
import egovframework.rte.fdl.cryptography.EgovPasswordEncoder;
|
||||
import nlib.cmm.crypto.AriaCrypto;
|
||||
import nlib.restful.service.DataApiReqVO;
|
||||
import nlib.restful.service.DataApiResVO;
|
||||
import nlib.user.service.MemberService;
|
||||
import nlib.user.service.NlibLoginVO;
|
||||
import nlib.util.StringUtil;
|
||||
|
||||
@Service("memberService")
|
||||
public class MemberServiceImpl implements MemberService
|
||||
@ -25,7 +29,8 @@ public class MemberServiceImpl implements MemberService
|
||||
@Resource(name = "egovEnvPasswordEncoderService")
|
||||
EgovPasswordEncoder egovPasswordEncoder;
|
||||
|
||||
|
||||
@Resource(name = "ariaCrypto")
|
||||
AriaCrypto ariaCrypto;
|
||||
|
||||
public DataApiResVO selectMemberJoiningInfo(DataApiReqVO reqVO) {
|
||||
return null;
|
||||
@ -192,4 +197,26 @@ public class MemberServiceImpl implements MemberService
|
||||
return dummyPW;
|
||||
}
|
||||
|
||||
public String selectAlreadySignUpId(OAuthUniversalUser oauthUser) throws Exception {
|
||||
//이메일 암호화
|
||||
oauthUser.setSnsEmail(ariaCrypto.encode(oauthUser.getSnsUserId()));
|
||||
return memberDAO.selectAlreadySignUpId(oauthUser);
|
||||
}
|
||||
|
||||
public void insertMemberSns(OAuthUniversalUser oauthUser) {
|
||||
//사용자 데이터 암호화
|
||||
if(!(StringUtil.getString(oauthUser.getSnsBirthday(),"") == ""))
|
||||
oauthUser.setSnsBirthday(ariaCrypto.encode(oauthUser.getSnsBirthday()));
|
||||
if(!(StringUtil.getString(oauthUser.getSnsEmail(),"") == ""))
|
||||
oauthUser.setSnsEmail(ariaCrypto.encode(oauthUser.getSnsEmail()));
|
||||
if(!(StringUtil.getString(oauthUser.getSnsMobileNo(),"") == ""))
|
||||
oauthUser.setSnsMobileNo(ariaCrypto.encode(oauthUser.getSnsMobileNo()));
|
||||
memberDAO.insertMemberSns(oauthUser);
|
||||
}
|
||||
|
||||
public List<NlibLoginVO> selectAlreadySignUpMobile(NlibLoginVO loginVO) throws Exception {
|
||||
loginVO.setMobileNo(ariaCrypto.encode(loginVO.getMobileNo()));
|
||||
return memberDAO.selectAlreadySignUpMobile(loginVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -329,7 +329,6 @@ public class LoginController {
|
||||
redirectUrl = NlibProperty.getString("member.new.url"); // "/member/insertMemberInfoForm.do"
|
||||
return "redirect:" + redirectUrl;
|
||||
}
|
||||
|
||||
//-----------------------------------------------
|
||||
// 해당 처리기로 전환
|
||||
//-----------------------------------------------
|
||||
|
||||
@ -16,6 +16,7 @@ import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.inject.Inject;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
@ -34,6 +35,7 @@ import org.springframework.ui.Model;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@ -51,7 +53,14 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
|
||||
import com.github.scribejava.core.model.OAuth2AccessToken;
|
||||
|
||||
import egovframework.com.ext.oauth.service.OAuthConfig;
|
||||
import egovframework.com.ext.oauth.service.OAuthLogin;
|
||||
import egovframework.com.ext.oauth.service.OAuthUniversalUser;
|
||||
import egovframework.com.ext.oauth.service.OAuthVO;
|
||||
import egovframework.rte.fdl.cryptography.EgovPasswordEncoder;
|
||||
import nlib.cmm.crypto.AriaCrypto;
|
||||
import nlib.cmm.service.NlibProperty;
|
||||
import nlib.cmm.session.SessionConfig;
|
||||
import nlib.cmm.snslogin.GoogleOAuthResponse;
|
||||
import nlib.cmm.snslogin.KakaoController;
|
||||
import nlib.cmm.snslogin.NaverLoginBO;
|
||||
@ -62,6 +71,7 @@ import nlib.restful.service.DataApiReqVO;
|
||||
import nlib.user.service.MemberService;
|
||||
import nlib.user.service.NlibLoginVO;
|
||||
import nlib.user.service.UserInfoService;
|
||||
import nlib.util.StringUtil;
|
||||
|
||||
import org.springframework.mail.javamail.JavaMailSender;
|
||||
|
||||
@ -91,6 +101,19 @@ import org.springframework.mail.javamail.JavaMailSender;
|
||||
@Controller
|
||||
public class MemberController {
|
||||
|
||||
//-------------------------------------------
|
||||
// SNS 연동 환경설정 정보 : context-oauth.xml 참고
|
||||
//-------------------------------------------
|
||||
@Inject
|
||||
private OAuthVO naverAuthVO; /* 네이버 */
|
||||
|
||||
@Inject
|
||||
private OAuthVO googleAuthVO; /* 구글 */
|
||||
|
||||
@Inject
|
||||
private OAuthVO kakaoAuthVO; /* 카카오 */
|
||||
//-------------------------------------------
|
||||
|
||||
@Resource(name="userInfoService")
|
||||
private UserInfoService userInfoService;
|
||||
|
||||
@ -162,50 +185,68 @@ public class MemberController {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 약관 동의화면
|
||||
* @param req
|
||||
* @param model
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/member/selectMemberJoiningInfo.do")
|
||||
public String selectMemberJoiningInfo(HttpServletRequest req,ModelMap model) {
|
||||
public String selectMemberJoiningInfo(HttpServletRequest req,ModelMap model,HttpSession session) throws Exception {
|
||||
return "/nlib/member/selectMemberJoiningInfo";
|
||||
}
|
||||
|
||||
@RequestMapping(value="/member/snsCertForm.do")
|
||||
public String snsCertForm(HttpSession session, Model model) throws Exception{
|
||||
// 네이버 로그인 URL 생성
|
||||
/* 네이버아이디로 인증 URL을 생성하기 위하여 naverLoginBO클래스의 getAuthorizationUrl메소드 호출 */
|
||||
naverLoginBO.setRedirect_url("http://nlib.nculture.org/nlib/member/naverCallback.do");
|
||||
String naverAuthUrl = naverLoginBO.getAuthorizationUrl(session);
|
||||
public String snsCertForm(HttpSession session,
|
||||
HttpServletRequest req,
|
||||
@RequestParam(required = false) String error,
|
||||
@RequestParam(required = false) String message,
|
||||
Model model) throws Exception{
|
||||
//----------------------------------------------
|
||||
// SNS 연동 URL 생성
|
||||
//----------------------------------------------
|
||||
OAuthLogin naverLogin = new OAuthLogin(naverAuthVO, OAuthLogin.CALL_TYPE_MEMBER);
|
||||
model.addAttribute("naverUrl", naverLogin.getOAuthURL());
|
||||
|
||||
// 구글 로그인 URL 생성
|
||||
String googleUrl = "https://accounts.google.com/o/oauth2/v2/auth?"
|
||||
+ "client_id=879126511006-jro7bld7b2epl3n5mkksp0p24k2inbpu.apps.googleusercontent.com"
|
||||
+ "&redirect_uri=http://nlib.nculture.org/nlib/member/googleCallback.do"
|
||||
+ "&response_type=code"
|
||||
+ "&scope=email%20profile%20openid"
|
||||
+ "&access_type=offline";
|
||||
|
||||
// 카카오 로그인 URL 생성
|
||||
String k_redirect_url="http://nlib.nculture.org/nlib/member/kakaoCallback.do";
|
||||
String kakaoUrl = KakaoController.getAuthorizationUrl(session,k_redirect_url);
|
||||
OAuthLogin googleLogin = new OAuthLogin(googleAuthVO, OAuthLogin.CALL_TYPE_MEMBER);
|
||||
model.addAttribute("googleUrl", googleLogin.getOAuthURL());
|
||||
|
||||
model.addAttribute("naverUrl", naverAuthUrl);
|
||||
model.addAttribute("googleUrl", googleUrl);
|
||||
model.addAttribute("kakaoUrl", kakaoUrl);
|
||||
OAuthLogin kakaoLogin = new OAuthLogin(kakaoAuthVO, OAuthLogin.CALL_TYPE_MEMBER);
|
||||
model.addAttribute("kakaoUrl", kakaoLogin.getOAuthURL());
|
||||
|
||||
model.addAttribute("error", error);
|
||||
model.addAttribute("message", message);
|
||||
return "nlib/member/snsCertForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 회원가입 폼
|
||||
* @exception Exception
|
||||
*/
|
||||
@RequestMapping(value="/member/insertMemberInfoForm.do")
|
||||
public String insertMemberInfoForm(HttpServletRequest request,NlibLoginVO vo,HttpSession session,ModelMap model ) throws Exception{
|
||||
Map<String, ?> flashMap =RequestContextUtils.getInputFlashMap(request);
|
||||
|
||||
/*if(flashMap != null)
|
||||
String jsessionId = session.getId();
|
||||
//String councilCd = (String)session.getAttribute("councilCd");
|
||||
//String councilReturnUrl = (String)session.getAttribute("councilReturnUrl");
|
||||
OAuthUniversalUser oauthUser = SessionConfig.getNewMemberInfo(jsessionId);
|
||||
|
||||
String mId = null;
|
||||
|
||||
// 등록된 ID가 있는 지 확인
|
||||
if(!(StringUtil.getString(oauthUser.getSnsUserId(),"")== ""))
|
||||
mId =memberService.selectAlreadySignUpId(oauthUser);
|
||||
|
||||
/* 등록된 ID가 있을때 통합처리 */
|
||||
if(!StringUtil.getString(mId, "").equals(""))
|
||||
{
|
||||
vo.setLoginUserId(String.valueOf(flashMap.get("email")));
|
||||
}else {
|
||||
return "forward:/member/selectMemberJoiningInfo.do";
|
||||
}*/
|
||||
model.addAttribute("loginVO",vo);
|
||||
oauthUser.setMbInfoId(mId);
|
||||
memberService.insertMemberSns(oauthUser);
|
||||
//통합처리 url
|
||||
return "redirect:/member/accountConsolidationForm.do";
|
||||
}
|
||||
model.addAttribute("loginVO",oauthUser);
|
||||
return "nlib/member/insertMemberInfoForm";
|
||||
}
|
||||
|
||||
@ -214,7 +255,23 @@ public class MemberController {
|
||||
* @exception Exception
|
||||
*/
|
||||
@RequestMapping(value="/member/insertMemberInfo.do")
|
||||
public String insertMemberInfo(NlibLoginVO vo) throws Exception{
|
||||
public String insertMemberInfo(NlibLoginVO vo,ModelMap model) throws Exception{
|
||||
List<NlibLoginVO> voList = new ArrayList<NlibLoginVO>();
|
||||
// 등록된 전화번호가 있는 지 확인 (리스트)
|
||||
voList = memberService.selectAlreadySignUpMobile(vo);
|
||||
|
||||
/* 등록된 ID가 있을때 통합처리 */
|
||||
if(voList.size() > 0)
|
||||
{
|
||||
/* oauthUser.setMbInfoId(mId);
|
||||
memberService.insertMemberSns(oauthUser);*/
|
||||
//통합처리 url
|
||||
System.out.println(voList.get(0).getEmail());
|
||||
System.out.println(voList.get(0).getMbInfoId());
|
||||
model.addAttribute("result",voList);
|
||||
return "nlib/member/accountConsolidationForm";
|
||||
}
|
||||
|
||||
//등록처리 요청 (data insert)
|
||||
memberService.insertMemberInfo(vo);
|
||||
|
||||
@ -235,9 +292,7 @@ public class MemberController {
|
||||
for(String readLine : list) {
|
||||
contents+=readLine;
|
||||
}
|
||||
/*contents=contents.replaceAll("[$]\\{userName\\}","유종선");*/
|
||||
contents=contents.replace("${userName}","유종선");
|
||||
System.out.println(contents);
|
||||
contents=contents.replace("${userName}",vo.getName());
|
||||
return "nlib/member/insertMemberInfoResult";
|
||||
}
|
||||
|
||||
@ -268,8 +323,8 @@ public class MemberController {
|
||||
* 핸드폰 인증번호 확인
|
||||
* @exception Exception
|
||||
*/
|
||||
@RequestMapping(value="/member/phoneCertNumChk.ajax" , method=RequestMethod.POST)
|
||||
public @ResponseBody String phoneCertNumChk(HttpServletResponse response,HttpServletRequest request) throws Exception{
|
||||
@RequestMapping(value="/member/mobileCertNumChk.ajax" , method=RequestMethod.POST)
|
||||
public @ResponseBody String mobileCertNumChk(HttpServletResponse response,HttpServletRequest request) throws Exception{
|
||||
String mobileNo = request.getParameter("mobileNo");
|
||||
String mobileCertNum = request.getParameter("mobileCertNum");
|
||||
|
||||
@ -362,32 +417,6 @@ public class MemberController {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* 회원가입 SNS 네이버인증
|
||||
* @param model
|
||||
* @param code
|
||||
* @param state
|
||||
* @param session
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws ParseException
|
||||
*/
|
||||
@RequestMapping(value = "/member/naverCallback.do", method = { RequestMethod.GET, RequestMethod.POST })
|
||||
public String naverCallback(Model model, @RequestParam String code, @RequestParam String state, HttpSession session,RedirectAttributes rttr)
|
||||
throws IOException, ParseException {
|
||||
OAuth2AccessToken oauthToken;
|
||||
oauthToken = naverLoginBO.getAccessToken(session, code, state);
|
||||
// 로그인 사용자 정보를 읽어온다.
|
||||
apiResult = naverLoginBO.getUserProfile(oauthToken);
|
||||
JSONParser parser = new JSONParser();
|
||||
Object obj = parser.parse(apiResult);
|
||||
JSONObject jsonObj = (JSONObject) obj;
|
||||
JSONObject response_obj = (JSONObject) jsonObj.get("response");
|
||||
String email = (String) response_obj.get("email");
|
||||
rttr.addFlashAttribute("email",email);
|
||||
/* 네이버 로그인 성공 페이지 View 호출 */
|
||||
return "redirect:/member/insertMemberInfoForm.do";
|
||||
}
|
||||
|
||||
/**
|
||||
* 회원가입 SNS 구글인증
|
||||
@ -437,67 +466,4 @@ public class MemberController {
|
||||
rttr.addFlashAttribute("email",userInfo.get("email"));
|
||||
return "redirect:/member/insertMemberInfoForm.do";
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 회원가입 SNS 카카오인증
|
||||
* @param code
|
||||
* @param request
|
||||
* @param response
|
||||
* @param session
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/member/kakaoCallback.do")
|
||||
public String kakaoCallback(@RequestParam("code") String code, HttpServletRequest request, HttpServletResponse response, HttpSession session
|
||||
,RedirectAttributes rttr)
|
||||
throws Exception {
|
||||
ModelAndView mav = new ModelAndView();
|
||||
// 결과값을 node에 담아줌
|
||||
String k_redirect_url="http://nlib.nculture.org/nlib/member/kakaoCallback.do";
|
||||
JsonNode node = KakaoController.getAccessToken(code,k_redirect_url);
|
||||
// accessToken에 사용자의 로그인한 모든 정보가 들어있음
|
||||
JsonNode accessToken = node.get("access_token");
|
||||
// 사용자의 정보
|
||||
JsonNode userInfo = KakaoController.getKakaoUserInfo(accessToken);
|
||||
String kemail = null;
|
||||
String kname = null;
|
||||
String kgender = null;
|
||||
String kbirthday = null;
|
||||
String kage = null;
|
||||
String kimage = null;
|
||||
// 유저정보 카카오에서 가져오기Get properties
|
||||
JsonNode properties = userInfo.path("properties");
|
||||
JsonNode kakao_account = userInfo.path("kakao_account");
|
||||
kemail = kakao_account.path("email").asText();
|
||||
kname = properties.path("nickname").asText();
|
||||
kimage = properties.path("profile_image").asText();
|
||||
kgender = kakao_account.path("gender").asText();
|
||||
kbirthday = kakao_account.path("birthday").asText();
|
||||
kage = kakao_account.path("age_range").asText();
|
||||
session.setAttribute("kemail", kemail);
|
||||
session.setAttribute("kname", kname);
|
||||
session.setAttribute("kimage", kimage);
|
||||
session.setAttribute("kgender", kgender);
|
||||
session.setAttribute("kbirthday", kbirthday);
|
||||
session.setAttribute("kage", kage);
|
||||
mav.setViewName("main");
|
||||
rttr.addFlashAttribute("email",kemail);
|
||||
return "redirect:/member/insertMemberInfoForm.do";
|
||||
}// end kakaoLogin()
|
||||
|
||||
/**
|
||||
* 주소검색 팝업
|
||||
* @param request
|
||||
* @param response
|
||||
* @param session
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/popup/jusoPopup.do")
|
||||
public String jusoPopup(HttpServletRequest request, HttpServletResponse response, HttpSession session)
|
||||
throws Exception {
|
||||
|
||||
return "nlib/popup/jusoPopup";
|
||||
}// end kakaoLogin()
|
||||
|
||||
}
|
||||
@ -12,8 +12,10 @@
|
||||
<result column="REG_ID" property="regId"/>
|
||||
<result column="MOD_ID" property="modId"/>
|
||||
<result column="MOBILE_NO" property="mobileNo"/>
|
||||
<result column="EMAIL" property="email"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 회원가입 -->
|
||||
<insert id="insertMemberInfo" parameterType="nlib.user.service.NlibLoginVO">
|
||||
<selectKey resultType="string" keyProperty="userId" order="BEFORE">
|
||||
SELECT CONCAT(LEFT(MAX(USER_ID),2),
|
||||
@ -25,6 +27,8 @@
|
||||
VALUES
|
||||
(#{userId},#{loginUserId},'N',#{userNm},#{userPwd},#{birthdate},#{gender},#{telNo},#{zipcode},#{addr1},#{addr2},#{userId},#{userId})
|
||||
</insert>
|
||||
|
||||
<!-- 비밀번호 변경 -->
|
||||
<update id="changePassword" parameterType="nlib.user.service.NlibLoginVO">
|
||||
UPDATE
|
||||
TMP_SM_USER
|
||||
@ -32,10 +36,83 @@
|
||||
USER_PWD=#{userPwd}
|
||||
,MOD_ID = #{userId}
|
||||
,MOD_DD = SYSDATE()
|
||||
|
||||
WHERE 1=1
|
||||
AND LOGIN_USER_ID = #{loginUserId}
|
||||
AND TEL_NO = #{telNo}
|
||||
|
||||
</update>
|
||||
<!-- 회원가입시 SNS인증한 계정 ID와 일치하는 계정이 있는지 체크 -->
|
||||
<select id="selectAlreadySignUpId" parameterType="egovframework.com.ext.oauth.service.OAuthUniversalUser" resultType="String">
|
||||
SELECT
|
||||
MB_INFO_ID
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
MB_INFO_ID
|
||||
,LOGIN_USER_ID
|
||||
,EMAIL
|
||||
FROM
|
||||
MB_INFO
|
||||
WHERE 1=1
|
||||
AND (LOGIN_USER_ID = #{snsUserId} OR EMAIL = #{snsEmail})
|
||||
UNION ALL
|
||||
SELECT
|
||||
MB_INFO_ID
|
||||
,SNS_USER_ID LOGIN_USER_ID
|
||||
,"" EMAIL
|
||||
FROM
|
||||
MB_SNS
|
||||
WHERE 1=1
|
||||
AND SNS_USER_ID = #{snsUserId}
|
||||
) MB
|
||||
GROUP BY MB_INFO_ID
|
||||
</select>
|
||||
|
||||
<!-- 회원가입시 입력한 휴대폰번호와 일치하는 계정이 있는지 체크 -->
|
||||
<select id="selectAlreadySignUpMobile" parameterType="nlib.user.service.NlibLoginVO" resultMap="NlibLoginVO">
|
||||
SELECT
|
||||
MB_INFO_ID
|
||||
,LOGIN_USER_ID
|
||||
,EMAIL
|
||||
FROM
|
||||
MB_INFO
|
||||
WHERE 1=1
|
||||
AND MOBILE_NO = #{mobileNo}
|
||||
</select>
|
||||
|
||||
<!-- 기존 계정 ID와 일치시 통합처리 -->
|
||||
<insert id="insertMemberSns" parameterType="egovframework.com.ext.oauth.service.OAuthUniversalUser">
|
||||
INSERT INTO
|
||||
MB_SNS
|
||||
(
|
||||
MB_INFO_ID
|
||||
,SNS_TYPE
|
||||
,SNS_ID
|
||||
,SNS_NAME
|
||||
,SNS_NICK_NAME
|
||||
,SNS_USER_ID
|
||||
,SNS_GENDER
|
||||
,SNS_BIRTHDAY
|
||||
,SNS_EMAIL
|
||||
,SNS_MOBILE_NO
|
||||
,REG_DD
|
||||
,UNLINK_DD
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#{mbInfoId}
|
||||
,#{snsType}
|
||||
,#{snsId}
|
||||
,#{snsName}
|
||||
,{snsNickName}
|
||||
,#{snsUserId}
|
||||
,#{snsGender}
|
||||
,#{snsBirthday}
|
||||
,#{snsEmail}
|
||||
,#{snsMobileNo}
|
||||
,#{mbInfoId}
|
||||
,NULL
|
||||
);
|
||||
|
||||
</insert>
|
||||
</mapper>
|
||||
@ -20,7 +20,7 @@ home.uri = /index.do
|
||||
#----------------------------------------
|
||||
# \ub85c\uadf8\uc778/\ud68c\uc6d0\uac00\uc785\uad00\ub828 URL \uc815\ubcf4
|
||||
#----------------------------------------
|
||||
member.new.url = /member/selectMemberJoiningInfo.do
|
||||
member.new.url = /member/snsCertForm.do
|
||||
# \ub85c\uadf8\uc778 \ub610\ub294 \uad8c\ud55c\uc5c6\ub294 \uacbd\uc6b0, \ub85c\uadf8\uc778\uc73c\ub85c \uc804\ud658\ucc98\ub9ac\ub418\uc5b4 \uc811\uc18d\ub418\ub294 \ucd5c\ucd08 \uc8fc\uc18c
|
||||
login.url = /login/loginCouncil.do
|
||||
# \ub85c\uadf8\uc778 \ubb38\uc81c \ubc1c\uc0dd \uc2dc, \ub2e4\uc2dc \ub9ac\ub2e4\uc774\ub809\ud2b8\ub420 \ub85c\uadf8\uc778\ud654\uba74 \uc8fc\uc18c
|
||||
@ -28,7 +28,7 @@ login.back.url = /login/loginForm.do
|
||||
# \uc9c0\ubc29\ubb38\ud654\uc6d0\uc5d0\uc11c \uc811\uc18d\uc2dc \ub9ac\ub2e4\uc774\ub809\ud2b8\ub420 URL \uc815\ubcf4
|
||||
nculture.login.redirect.uri = /login/loginForm.do
|
||||
nculture.login.post.login.redirect.uri = /login/loginCouncilSSO.do
|
||||
nculture.login.post.member.redirect.uri = /member/insertMemberInfoForm.do
|
||||
nculture.login.post.member.redirect.uri = /member/selectMemberJoiningInfo.do
|
||||
nculture.login.preset.redirect.url = http://nlib.nculture.org/nlib/login/loginPreSet.do
|
||||
nculture.member.redirect.uri = /member/snsCertForm.do
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
|
||||
<script>
|
||||
function signUp(){
|
||||
location.href="${pageContext.request.contextPath}/member/selectMemberJoiningInfo.do";
|
||||
location.href="${pageContext.request.contextPath}/login/loginCouncil.do?callType=member";
|
||||
}
|
||||
function findInfo(){
|
||||
location.href="${pageContext.request.contextPath}/member/initPasswordForm.do";
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
<%
|
||||
/**
|
||||
* <pre>
|
||||
* @Class Name : accountConsolidationForm.jsp
|
||||
*
|
||||
* @Description : 계정통합처리 알림폼
|
||||
*
|
||||
*
|
||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 2021. 9. 1. JSYOO 최초 생성
|
||||
*
|
||||
*
|
||||
* @author 이씨플라자 * DIGITALSHIP JSYOO
|
||||
* @since 2021. 9. 1.
|
||||
* @version 1.0
|
||||
*
|
||||
*/
|
||||
%>
|
||||
<%@ 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>
|
||||
</head>
|
||||
<body>
|
||||
<h1>계정이 통합되었습니다.</h1>
|
||||
<c:forEach items="${result}" var="result">
|
||||
|
||||
<tr>
|
||||
<td><c:out value="${result.mbInfoId}"/></td>
|
||||
<td><c:out value="${result.loginUserId}"/></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</body>
|
||||
</html>
|
||||
@ -35,7 +35,6 @@
|
||||
<head>
|
||||
<title>${pageTitle} <spring:message code="title.create" /></title>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
|
||||
<script type="text/javaScript" language="javascript" defer="defer">
|
||||
function signUp(){
|
||||
var p = document.getElementById('password');
|
||||
@ -77,15 +76,29 @@ function signUp(){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function goPopup(){
|
||||
// 주소검색을 수행할 팝업 페이지를 호출합니다.
|
||||
// 호출된 페이지(jusopopup.jsp)에서 실제 주소검색URL(http://www.juso.go.kr/addrlink/addrLinkUrl.do)를 호출하게 됩니다.
|
||||
var pop = window.open("/nlib/popup/jusoPopup.do","pop","width=570,height=420, scrollbars=yes, resizable=yes");
|
||||
|
||||
// 모바일 웹인 경우, 호출된 페이지(jusopopup.jsp)에서 실제 주소검색URL(http://www.juso.go.kr/addrlink/addrMobileLinkUrl.do)를 호출하게 됩니다.
|
||||
//var pop = window.open("/popup/jusoPopup.jsp","pop","scrollbars=yes, resizable=yes");
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("input:radio[name='gender']:radio[value='${loginVO.snsGender}']").prop('checked', true);
|
||||
|
||||
var birthday="${loginVO.snsBirthday}";
|
||||
|
||||
if(!birthday == "")
|
||||
{
|
||||
var birth_yy =birthday.substr(0,4);
|
||||
var birth_mm =birthday.substr(4,2);
|
||||
var birth_dd =birthday.substr(6,2);
|
||||
|
||||
if(birth_dd.substr(0,1) == "0")
|
||||
{
|
||||
birth_dd = birth_dd.substr(1,1)
|
||||
}
|
||||
|
||||
$("#birth_yy").val(birth_yy)
|
||||
$("#birth_mm").val(birth_mm).prop("selected", true);
|
||||
$("#birth_dd").val(birth_dd)
|
||||
}
|
||||
|
||||
|
||||
<%
|
||||
//핸드폰 번호가 변하는것 실시간 감지
|
||||
%>
|
||||
@ -186,14 +199,6 @@ function certNumCheck(){
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function jusoCallBack(zipNo,roadAddrPart,addrDetail){
|
||||
// 팝업페이지에서 주소입력한 정보를 받아서, 현 페이지에 정보를 등록합니다.
|
||||
$("#zipCode").val(zipNo);
|
||||
$("#address").val(roadAddrPart);
|
||||
$("#addressDetail").val(addrDetail);
|
||||
}
|
||||
|
||||
document.addEventListener('keydown', function(event) {
|
||||
if (event.keyCode === 13) {
|
||||
event.preventDefault();
|
||||
@ -365,14 +370,14 @@ label.error {
|
||||
<tr>
|
||||
<td id="title">아이디</td>
|
||||
<td>
|
||||
<input type="email" id="loginUserId" name="loginUserId" maxlength="30" required value="<c:out value="${loginVO.loginUserId}"/>" ><button type="button" id="getEmailCert" name="getEmailCert" style="text-align:left;display:none;" class="btn-warning" onclick="emailCert()" required>인증번호 받기</button>
|
||||
<input type="email" id="loginUserId" name="loginUserId" maxlength="30" required value="<c:out value="${loginVO.snsUserId}"/>" ><button type="button" id="getEmailCert" name="getEmailCert" style="text-align:left;display:none;" class="btn-warning" onclick="emailCert()" required>인증번호 받기</button>
|
||||
<div id="phoneCertForm" style="display:none;"><br><input type='text' id='phoneCertNum' name='phoneCertNum'> <button type='button' style='text-align:left;' class='btn-warning' onclick='certNumCheck()' >인증번호 확인</button></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="title">이름</td>
|
||||
<td>
|
||||
<input type="text" id="name" name="name" maxlength="20" required >
|
||||
<input type="text" id="name" name="name" maxlength="20" value="<c:out value="${loginVO.snsName}"/>" required >
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -424,15 +429,15 @@ label.error {
|
||||
<tr>
|
||||
<td id="title">주소</td>
|
||||
<td>
|
||||
<input type="text" id="zipCode" name="zipCode" ><button type="button" style="text-align:left;" class="btn-warning" onclick="goPopup()">주소검색</button><br>
|
||||
<input type="text" id="address" name="address" ><input type="text" id="addressDetail" name="addressDetail" >
|
||||
<input type="text" id="zipCode" name="zipCode" readonly><button type="button" style="text-align:left;" class="btn-warning" onclick="sample6_execDaumPostcode()">주소검색</button><br>
|
||||
<input type="text" id="address" name="address" readonly><input type="text" id="addressDetail" name="addressDetail" >
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td id="title">휴대전화</td>
|
||||
<td id="Cert">
|
||||
<input type="text" id="mobileNo" name="mobileNo" required ><button type="button" style="text-align:left;" class="btn-warning" onclick="mobileCert()" required>인증번호 받기</button>
|
||||
<input type="text" id="mobileNo" name="mobileNo" value="<c:out value="${loginVO.snsMobileNo}"/>" required ><button type="button" style="text-align:left;" class="btn-warning" onclick="mobileCert()" required>인증번호 받기</button>
|
||||
<div id="mobileCertForm" style="display:none;"><br><input type='text' id='mobileCertNum' name='mobileCertNum'> <button type='button' style='text-align:left;' class='btn-warning' onclick='certNumCheck()' >인증번호 확인</button></div>
|
||||
</td>
|
||||
</tr>
|
||||
@ -445,6 +450,34 @@ label.error {
|
||||
<input type="submit" value="가입"/>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
<script src="//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js"></script>
|
||||
<script>
|
||||
function sample6_execDaumPostcode() {
|
||||
new daum.Postcode({
|
||||
oncomplete: function(data) {
|
||||
// 팝업에서 검색결과 항목을 클릭했을때 실행할 코드를 작성하는 부분.
|
||||
|
||||
// 각 주소의 노출 규칙에 따라 주소를 조합한다.
|
||||
// 내려오는 변수가 값이 없는 경우엔 공백('')값을 가지므로, 이를 참고하여 분기 한다.
|
||||
var addr = ''; // 주소 변수
|
||||
var extraAddr = ''; // 참고항목 변수
|
||||
|
||||
//사용자가 선택한 주소 타입에 따라 해당 주소 값을 가져온다.
|
||||
if (data.userSelectedType === 'R') { // 사용자가 도로명 주소를 선택했을 경우
|
||||
addr = data.roadAddress;
|
||||
} else { // 사용자가 지번 주소를 선택했을 경우(J)
|
||||
addr = data.jibunAddress;
|
||||
}
|
||||
|
||||
// 우편번호와 주소 정보를 해당 필드에 넣는다.
|
||||
document.getElementById('zipCode').value = data.zonecode;
|
||||
document.getElementById("address").value = addr;
|
||||
// 커서를 상세주소 필드로 이동한다.
|
||||
document.getElementById("addressDetail").focus();
|
||||
}
|
||||
}).open();
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
function snsCertForm(){
|
||||
if(document.getElementById('agree').checked)
|
||||
{
|
||||
location.href="${pageContext.request.contextPath}/member/snsCertForm.do";
|
||||
location.href="${pageContext.request.contextPath}/member/insertMemberInfoForm.do";
|
||||
}
|
||||
else{
|
||||
alert("약관에 동의해주세요");
|
||||
|
||||
@ -1,76 +0,0 @@
|
||||
<%
|
||||
/**
|
||||
* <pre>
|
||||
* @Class Name : jusoPopup.jsp
|
||||
*
|
||||
* @Description : 주소 API
|
||||
*
|
||||
*
|
||||
* @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------------ -------- ---------------------------
|
||||
* @ 2021. 7. 12. JSYOO 최초 생성
|
||||
*
|
||||
*
|
||||
* @author 이씨플라자 * DIGITALSHIP JSYOO
|
||||
* @since 2021. 7. 12.
|
||||
* @version 1.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>
|
||||
<%
|
||||
request.setCharacterEncoding("UTF-8"); //한글깨지면 주석제거
|
||||
//request.setCharacterEncoding("EUC-KR"); //해당시스템의 인코딩타입이 EUC-KR일경우에
|
||||
String inputYn = request.getParameter("inputYn");
|
||||
String zipNo = request.getParameter("zipNo");
|
||||
String roadAddrPart1 = request.getParameter("roadAddrPart1");
|
||||
String roadAddrPart2 = request.getParameter("roadAddrPart2");
|
||||
String addrDetail = request.getParameter("addrDetail");
|
||||
|
||||
%>
|
||||
</head>
|
||||
<script language="javascript">
|
||||
// opener관련 오류가 발생하는 경우 아래 주석을 해지하고, 사용자의 도메인정보를 입력합니다. ("주소입력화면 소스"도 동일하게 적용시켜야 합니다.)
|
||||
//document.domain = "abc.go.kr";
|
||||
|
||||
function init(){
|
||||
var url = location.href;
|
||||
var confmKey = "devU01TX0FVVEgyMDIxMDgxOTEwMTkxNjExMTU0MTU=";
|
||||
var resultType = "4"; // 도로명주소 검색결과 화면 출력내용, 1 : 도로명, 2 : 도로명+지번, 3 : 도로명+상세건물명, 4 : 도로명+지번+상세건물명
|
||||
var inputYn= "<%=inputYn%>";
|
||||
if(inputYn != "Y"){
|
||||
document.form.confmKey.value = confmKey;
|
||||
document.form.returnUrl.value = url;
|
||||
document.form.resultType.value = resultType;
|
||||
document.form.action="http://www.juso.go.kr/addrlink/addrLinkUrl.do"; //인터넷망
|
||||
//document.form.action="http://www.juso.go.kr/addrlink/addrMobileLinkUrl.do"; //모바일 웹인 경우, 인터넷망
|
||||
document.form.submit();
|
||||
}else{
|
||||
opener.jusoCallBack("<%=zipNo%>","<%=roadAddrPart1+roadAddrPart2%>","<%=addrDetail%>");
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<body onload="init();">
|
||||
<form id="form" name="form" method="post">
|
||||
<input type="hidden" id="confmKey" name="confmKey" value=""/>
|
||||
<input type="hidden" id="returnUrl" name="returnUrl" value=""/>
|
||||
<input type="hidden" id="resultType" name="resultType" value=""/>
|
||||
<!-- 해당시스템의 인코딩타입이 EUC-KR일경우에만 추가 START-->
|
||||
<!--
|
||||
<input type="hidden" id="encodingType" name="encodingType" value="EUC-KR"/>
|
||||
-->
|
||||
<!-- 해당시스템의 인코딩타입이 EUC-KR일경우에만 추가 END-->
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@ -106,15 +106,6 @@ function update(){
|
||||
}
|
||||
}
|
||||
|
||||
function goPopup(){
|
||||
// 주소검색을 수행할 팝업 페이지를 호출합니다.
|
||||
// 호출된 페이지(jusopopup.jsp)에서 실제 주소검색URL(http://www.juso.go.kr/addrlink/addrLinkUrl.do)를 호출하게 됩니다.
|
||||
var pop = window.open("/nlib/popup/jusoPopup.do","pop","width=570,height=420, scrollbars=yes, resizable=yes");
|
||||
|
||||
// 모바일 웹인 경우, 호출된 페이지(jusopopup.jsp)에서 실제 주소검색URL(http://www.juso.go.kr/addrlink/addrMobileLinkUrl.do)를 호출하게 됩니다.
|
||||
//var pop = window.open("/popup/jusoPopup.jsp","pop","scrollbars=yes, resizable=yes");
|
||||
}
|
||||
|
||||
<%
|
||||
//핸드폰 인증번호 받기
|
||||
%>
|
||||
@ -171,14 +162,6 @@ function certNumCheck(){
|
||||
})
|
||||
}
|
||||
|
||||
function jusoCallBack(zipNo,roadAddrPart,addrDetail){
|
||||
// 팝업페이지에서 주소입력한 정보를 받아서, 현 페이지에 정보를 등록합니다.
|
||||
$("#zipCode").val(zipNo);
|
||||
$("#address").val(roadAddrPart);
|
||||
$("#addressDetail").val(addrDetail);
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener('keydown', function(event) {
|
||||
if (event.keyCode === 13) {
|
||||
event.preventDefault();
|
||||
@ -428,5 +411,4 @@ label.error {
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
@ -31,7 +31,7 @@ String councilNm = (String)session.getAttribute("councilCd");
|
||||
</sec:authorize>
|
||||
<sec:authorize access="not isAuthenticated()">
|
||||
<li><a href="javascript:void(0)" onclick="javascript:location.href='${pageContext.request.contextPath}/user/member/searchIdForm.do';">ID/PW찾기</a></li>
|
||||
<li><a href="javascript:void(0)" onclick="javascript:location.href='${pageContext.request.contextPath}/login/loginForm.do';">회원가입</a></li>
|
||||
<li><a href="javascript:void(0)" onclick="javascript:location.href='${pageContext.request.contextPath}/login/loginCouncil.do?callType=member';">회원가입</a></li>
|
||||
</sec:authorize>
|
||||
<li>
|
||||
<sec:authorize access="isAuthenticated()">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user