jsshin 5 éve
szülő
commit
08e13e5be0

+ 4 - 1
pom.xml

@@ -59,7 +59,10 @@
 			<artifactId>commons-io</artifactId>
 			<version>2.6</version>
 		</dependency>
-		
+		<dependency>
+			<groupId>com.googlecode.libphonenumber</groupId>
+			<artifactId>libphonenumber</artifactId>
+		</dependency>
 		<!-- /// WEB-INF lib -->
 		<dependency>
 			<groupId>com.gagaframework</groupId>

+ 13 - 0
src/main/java/com/style24/front/biz/dao/TsfCustomerDao.java

@@ -1,6 +1,7 @@
 package com.style24.front.biz.dao;
 
 import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.CustSnsInfo;
 import com.style24.persistence.domain.Customer;
 
 /**
@@ -47,4 +48,16 @@ public interface TsfCustomerDao {
 	 * @since 2021. 02. 22
 	 */
 	int createCustomerSns(Customer customer);
+
+	/**
+	 * 활동, 휴면 테이블 조회
+	 * @param customer - 고객정보
+	 * @return 고객정보
+	 * @author jsshin
+	 * @since 2021. 02. 24
+	 */
+	Customer getCusomterActiveAndDormant(Customer customer);
+
+
+	Customer getCusomterSnsFind(CustSnsInfo custSnsInfo);
 }

+ 165 - 9
src/main/java/com/style24/front/biz/service/TsfCustomerService.java

@@ -1,12 +1,16 @@
 package com.style24.front.biz.service;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.gagaframework.web.parameter.GagaMap;
 import com.gagaframework.web.security.GagaPasswordEncoder;
 import com.style24.core.biz.service.TscCustomerService;
 import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.session.TscSession;
+import com.style24.core.support.util.CryptoUtils;
 import com.style24.front.support.security.TsfLoginDetails;
+import com.style24.front.support.security.session.TsfSession;
 import com.style24.persistence.domain.Coupon;
+import com.style24.persistence.domain.CustSnsInfo;
 import com.style24.persistence.domain.Customer;
 import com.style24.persistence.domain.Login;
 import com.style24.persistence.domain.Point;
@@ -47,6 +51,9 @@ public class TsfCustomerService {
 	@Autowired
 	private TsfLoginService loginService;
 
+	@Autowired
+	private ObjectMapper objectMapper;
+
 
 	/**
 	 * 고객아이디 찾기
@@ -60,9 +67,27 @@ public class TsfCustomerService {
 		TscSession.setAttribute("maskingYn","Y");
 		customer.setSiteCd(TscConstants.Site.STYLE24.value());
 		customer.encryptData(); // 데이터 암호하
+		return customerDao.getCusomterActiveAndDormant(customer);
+	}
+
+	/**
+	 * 고객정보찾기 -
+	 *
+	 * @param custNo - 고객번호
+	 * @return Customer 고객정보
+	 * @author jsshin
+	 * @since 2021. 02. 24
+	 */
+	public Customer getCustomerFindByCustNo(Integer custNo) {
+		Customer customer = new Customer();
+		customer.setCustNo(custNo);
+		customer.setCustStat(TscConstants.CustStat.ACTIVE.value());
+		customer.setSiteCd(TscConstants.Site.STYLE24.value());
+		customer.encryptData();
 		return coreCustomerService.getCustomerInfo(customer);
 	}
 
+
 	/**
 	 * 임시비밀번호 조회
 	 * @param length - 비밀번호 자릿수
@@ -122,9 +147,27 @@ public class TsfCustomerService {
 		return result > 0;
 	}
 
+	/**
+	 * 해당 휴대전화로 가입된 이력이 있는지 확인
+	 * @param cellPhnno - 휴대전화
+	 * @return boolean - 있으면 TRUE/ 없으면 FALSE
+	 * @author jsshin
+	 * @since 2021. 02. 15
+	 */
+	public boolean getCustomerFindByCellPhnnoCount(String cellPhnno) {
+		Customer customer = new Customer();
+		customer.setCellPhnno(cellPhnno);
+		customer.setHypenCellPhone(); // 010-0000-0000
+		customer.setSiteCd(TscConstants.Site.STYLE24.value());
+		customer.encryptData();
+		int result = customerDao.getCustomerInfoCount(customer);
+
+		return result > 0;
+	}
+
 	/**
 	 * 해당 CI로 가입된 이력이 있는지 확인
-	 * @param ci - ci
+	 * @param ci - 연계정보
 	 * @return boolean - 있으면 TRUE/ 없으면 FALSE
 	 * @author jsshin
 	 * @since 2021. 02. 15
@@ -141,7 +184,7 @@ public class TsfCustomerService {
 	/**
 	 * 해당 휴대폰 번호로 가입된 이력이 있는지 확인
 	 * @param cellPhnno - 휴대전화번호
-	 * @return boolean - 있으면 TRUE/ 없으면 FALSE
+	 * @return Customer - 고객정보
 	 * @author jsshin
 	 * @since 2021. 02. 15
 	 */
@@ -201,8 +244,9 @@ public class TsfCustomerService {
 	}
 
 	/**
-	 * 회원가입 처리
-	 * @param customer - 일반가입, SNS 가입
+	 * 회원가입 처리 - 일반가입
+	 * @param customer - 일반가입
+	 * @return boolean - 가입 성공 true / 실패 false
 	 * @author jsshin
 	 * @since 2021. 02. 19
 	 */
@@ -210,17 +254,50 @@ public class TsfCustomerService {
 	public boolean saveJoinCustomer(Customer customer) {
 		boolean isJoin = true;
 		// 1. validation
+		customer.setHypenCellPhone();
 		customer.encryptData();
-		if (StringUtils.isNotBlank(customer.getSnsId())) {
-			customer.setEncodedPasswd(" ");
-			customer.setCustId(customer.getSnsType()+"_"+customer.getSnsId());
+		customer.setEncodedPasswd(passwordEncoder.encode(customer.getPasswd()));
+
+		customer.setCustStat(TscConstants.CustStat.ACTIVE.value());
+		customer.setCustGb(TscConstants.CustGb.NORMAL.value());
+		customer.setCustGrade(TscConstants.CustGrade.WELCOME.value());
+
+		int custCnt = customerDao.createCustomer(customer);
+
+		if (custCnt > 0) {
+			saveJoinPostProcessing(customer);
 		} else {
-			customer.setEncodedPasswd(passwordEncoder.encode(customer.getPasswd()));
+			isJoin = false;
 		}
+
+		return isJoin;
+	}
+
+	/**
+	 * 회원가입 처리 - SNS 간편가입
+	 * @param customer - SNS 정보
+	 * @return boolean - 가입 성공 true / 실패 false
+	 * @author jsshin
+	 * @since 2021. 02. 19
+	 */
+	public boolean saveJoinCustomerSns (Customer customer) {
+		boolean isJoin = true;
+		customer.setEncodedPasswd(" ");
+		customer.setCustId(customer.getSnsType()+"_"+customer.getSnsId());
+		customer.setEncodedPasswd(passwordEncoder.encode(customer.getPasswd()));
+		customer.encryptData();
+
+		String gender = "G007_"+customer.getSexGb();
+		customer.setSexGb(gender);
+		customer.setSiteCd(TscConstants.Site.STYLE24.value());
+		customer.setFrontGb(TsfSession.getFrontGb());
+		customer.setAfLinkCd(TsfSession.getAttribute("afLinkCd"));
 		customer.setCustStat(TscConstants.CustStat.ACTIVE.value());
 		customer.setCustGb(TscConstants.CustGb.NORMAL.value());
 		customer.setCustGrade(TscConstants.CustGrade.WELCOME.value());
+
 		int custCnt = customerDao.createCustomer(customer);
+		customerDao.createCustomerSns(customer);
 
 		if (custCnt > 0) {
 			saveJoinPostProcessing(customer);
@@ -229,6 +306,7 @@ public class TsfCustomerService {
 		}
 
 		return isJoin;
+
 	}
 
 	/**
@@ -249,9 +327,87 @@ public class TsfCustomerService {
 
 	}
 
+
+	/**
+	 * Sns 정보에대한 상태 처리
+	 * @param custSnsInfo
+	 * @author jsshin
+	 * @since 2021. 02. 19
+	 */
+	@Transactional("shopTxnManager")
+	public GagaMap customerSnsProcessing (CustSnsInfo custSnsInfo) {
+		GagaMap resultMap = new GagaMap();
+		Customer custInfo;
+
+		// 1. snsId, snsType 값으로 연동되어져 있는지 확인
+		custInfo = customerDao.getCusomterSnsFind(custSnsInfo);
+		if (custInfo != null) {
+			resultMap.setString("custStat", "SUCC_CUST");
+			return resultMap;
+		}
+
+		// 2. CI(연계정보)로 가입 되어져 있는 고객이 있는지 ?
+		custInfo = getCustomerFindByCi(custSnsInfo.getCi());
+
+		if (custInfo != null) { // 2-1. 고객정보 있는경우
+			if (TscConstants.CustStat.SECEDE.value().equals(custInfo.getCustStat())) {
+				resultMap.setString("custStat", "SECEDE_CUST"); // 탈퇴 회원
+				return resultMap;
+			}
+			if (TscConstants.CustStat.DORMANT.value().equals(custInfo.getCustStat())) {
+				resultMap.setString("custStat", "DORMANT_CUST"); // 휴면 회원
+				return resultMap;
+			}
+			if (TscConstants.CustStat.ACTIVE.value().equals(custInfo.getCustStat())) {
+
+				if (StringUtils.isBlank(custSnsInfo.getCellPhnno())) {
+					resultMap.setString("custStat", "EMPTY_PHONE_CUST");
+					return resultMap;
+				}
+				custInfo.setSnsId(custSnsInfo.getSnsId());
+				custInfo.setSnsType(custSnsInfo.getSnsType());
+				customerDao.createCustomerSns(custInfo);
+				resultMap.setString("custStat", "SUCC_CUST");
+				return resultMap;
+			}
+		} else { // 2-2. 고객정보 없는 경우
+
+			if (StringUtils.isBlank(custSnsInfo.getCellPhnno())) { // 휴대전화번호가 없는 경우
+				resultMap.setString("custStat", "EMPTY_PHONE_CUST");
+				return resultMap;
+			}
+
+			boolean isFindByPhone =getCustomerFindByCellPhnnoCount(custSnsInfo.getCellPhnno().replace("-",""));
+			if (isFindByPhone) {
+				resultMap.setString("custStat", "DUP_PHONE_CUST");
+				return resultMap;
+			}
+
+			boolean isFindByEmail = getCustomerFindByEmail(custSnsInfo.getEmail());
+			if (isFindByEmail) {
+				resultMap.setString("custStat", "DUP_EMAIL_CUST"); // 이메일 중복
+				return resultMap;
+			}
+
+			Customer customer = objectMapper.convertValue(custSnsInfo, Customer.class);
+
+			boolean isJoin = saveJoinCustomerSns(customer);
+
+			if (isJoin) {
+				resultMap.setString("custStat", "SUCC_CUST");
+			} else {
+				resultMap.setString("custStat", "FAIL_CUST");
+			}
+
+		}
+
+		return resultMap;
+	}
+
+
 	/**
 	 * 로그인 처리
-	 * @param custNo - 고객번호
+	 * @param custId - 고객아이디
 	 * @param request - 요청
 	 * @author jsshin
 	 * @since 2021. 02. 18

+ 116 - 21
src/main/java/com/style24/front/biz/thirdparty/KaKaoLogin.java

@@ -2,8 +2,12 @@ package com.style24.front.biz.thirdparty;
 
 import com.gagaframework.web.parameter.GagaMap;
 import com.gagaframework.web.util.GagaFileUtil;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
 import com.google.gson.JsonObject;
-import com.google.gson.JsonParser;
+import com.google.i18n.phonenumbers.NumberParseException;
+import com.google.i18n.phonenumbers.PhoneNumberUtil;
+import com.google.i18n.phonenumbers.Phonenumber;
 import com.style24.front.support.security.session.TsfSession;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -20,6 +24,7 @@ import org.springframework.web.client.RestTemplate;
 
 import javax.annotation.PostConstruct;
 import java.net.URI;
+import java.util.Locale;
 
 
 /**
@@ -38,6 +43,8 @@ public class KaKaoLogin {
 	@Autowired
 	private RestTemplate restTemplate;
 
+	public static final String PROTOCOL = "http://";
+
 	private String callBackUrl;
 	private String restApiKey;
 	private String profiles;
@@ -66,17 +73,39 @@ public class KaKaoLogin {
 		log.info("\n--- Kakao initialization completed ----\n");
 	}
 
+	/**
+	 * 카카오 로그인 창
+	 * @param state - 콜백 시 해당 값으로 비교 및 모바일을 redirect 값이 있음
+	 * @return String - 호출 url정보
+	 * @author jsshin
+	 * @since 2021. 02. 05
+	 */
 	public String getAuthorizeUrl(String state) {
-		String apiUrl = authorizeUrl;
-		String redirectUri = GagaFileUtil.getConcatenationPath("https://" + TsfSession.getHttpServletRequest().getServerName(), callBackUrl);
-		apiUrl += "?client_id=" + restApiKey + "&redirect_uri=" + redirectUri + "&response_type=code&state=" + state;
-		log.info("api ===> {}", apiUrl);
-		return apiUrl;
+		StringBuilder apiUrlBuilder = new StringBuilder();
+		String redirectUri = GagaFileUtil.getConcatenationPath(PROTOCOL + TsfSession.getHttpServletRequest().getServerName(), callBackUrl);
+		apiUrlBuilder.append(authorizeUrl)
+				.append("?client_id=")
+				.append(restApiKey)
+				.append("&redirect_uri=")
+				.append(redirectUri)
+				.append("&response_type=code&state=")
+				.append(state);
+		log.info("apiUrlBuilder ===> {}", apiUrlBuilder.toString());
+		return apiUrlBuilder.toString();
 	}
 
+	/**
+	 * 카카오 전달 받은 코드 값으로 토근값을 받아옴(API)
+	 *
+	 * @param code - 카카오에서 전달 해준 값
+	 * @param state - 콜백 시 해당 값으로 비교 및 모바일을 redirect 값이 있음
+	 * @return GagaMap - 통신으로 받아온 정보
+	 * @author jsshin
+	 * @since 2021. 02. 05
+	 */
 	public GagaMap getAccessTocken(String code, String state) {
 		GagaMap resultMap = new GagaMap();
-		String redirectUri = GagaFileUtil.getConcatenationPath("https://" + TsfSession.getHttpServletRequest().getServerName(), callBackUrl);
+		String redirectUri = GagaFileUtil.getConcatenationPath(PROTOCOL + TsfSession.getHttpServletRequest().getServerName(), callBackUrl);
 		String requestGb = "";
 		try {
 			MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
@@ -89,7 +118,7 @@ public class KaKaoLogin {
 			// state 값에 리다이렉트 url 같이 넘겨줌
 			if (StringUtils.isNotBlank(state)) {
 				String[] stateArr = StringUtils.split(state, "!@!");
-				   requestGb = stateArr[1];
+				requestGb = stateArr[1];
 			}
 
 			// Header
@@ -106,17 +135,24 @@ public class KaKaoLogin {
 			String jsonResult = responseEntity.getBody();
 			log.info("responseEntity.getBody(): {} ", jsonResult);
 
-			JsonObject obj = new JsonParser().parse(jsonResult).getAsJsonObject();
-
-			resultMap.setString("access_token", obj.get("access_token").toString());
-			resultMap.setString("refresh_token", obj.get("refresh_token").toString());
+			Gson gson = new GsonBuilder().create();
+			resultMap = gson.fromJson(jsonResult, GagaMap.class); //access_token, refresh_token
 			resultMap.setString("requestGb", requestGb);
+
 		} catch (Exception e) {
 			log.error(e.getMessage());
 		}
 		return resultMap;
 	}
 
+	/**
+	 * 카카오 사용자 정보
+	 *
+	 * @param accessToken - 해당 값으로 사용자 정보를 가져옴
+	 * @return GagaMap - 사용자 정보
+	 * @author jsshin
+	 * @since 2021. 02. 05
+	 */
 	public GagaMap getKakaoUserInfo(String accessToken) {
 		GagaMap resultMap = new GagaMap();
 		try {
@@ -137,12 +173,34 @@ public class KaKaoLogin {
 			String jsonResult = responseEntity.getBody();
 			log.info("responseEntity.getBody(): {} ", jsonResult);
 
+			Gson gson = new GsonBuilder().create();
+
+			JsonObject obj = gson.fromJson(jsonResult, JsonObject.class);
+			GagaMap properties = gson.fromJson(obj.get("properties"), GagaMap.class);
+			GagaMap kakaoAccount = gson.fromJson(obj.get("kakao_account"), GagaMap.class);
+
+			Locale locale = Locale.KOREA;
+			String cellPhnno = getPhoneNumber(kakaoAccount.getString("phone_number"), locale.getCountry());
+			String birthYmd = kakaoAccount.getString("birthyear") + kakaoAccount.getString("birthday");
+
+			String sexGb = "";
+			if (StringUtils.isNotBlank(kakaoAccount.getString("gender"))) {
+				sexGb = kakaoAccount.getString("gender").equals("male") ? "M" : "F";
+			}
 
-			JsonObject obj = new JsonParser().parse(jsonResult).getAsJsonObject();
-			JsonObject properties = obj.get("properties").getAsJsonObject();
+			String birthSm = "";
+			if (StringUtils.isNotBlank(kakaoAccount.getString("birthday_type"))) {
+				birthSm = kakaoAccount.getString("birthday_type").equals("SOLAR") ? "S":"L";
+			}
 
-			resultMap.setString("id", obj.get("id").toString());
-			resultMap.setString("name", properties.get("nickname").toString());
+			resultMap.setString("snsId", obj.get("id").toString());
+			resultMap.setString("custNm", properties.getString("nickname"));
+			resultMap.setString("email", kakaoAccount.getString("email"));
+			resultMap.setString("ci", kakaoAccount.getString("ci"));
+			resultMap.setString("cellPhnno", cellPhnno);
+			resultMap.setString("birthYmd", birthYmd);
+			resultMap.setString("birthSm", birthSm);
+			resultMap.setString("sexGb", sexGb);
 
 		} catch (Exception e) {
 			log.error(e.getMessage());
@@ -150,6 +208,14 @@ public class KaKaoLogin {
 		return resultMap;
 	}
 
+	/**
+	 * 카카오 access_token 새로 발급
+	 *
+	 * @param refreshToken - 해당 값으로 사용자 정보를 가져옴
+	 * @return GagaMap - access_token 값을 준다.
+	 * @author jsshin
+	 * @since 2021. 02. 05
+	 */
 	public GagaMap getRefreshTocken(String refreshToken) {
 		GagaMap resultMap = new GagaMap();
 		try {
@@ -172,15 +238,22 @@ public class KaKaoLogin {
 			String jsonResult = responseEntity.getBody();
 			log.info("responseEntity.getBody(): {} ", jsonResult);
 
-			JsonObject obj = new JsonParser().parse(jsonResult).getAsJsonObject();
-			resultMap.setString("access_token", obj.get("access_token").toString());
-
+			Gson gson = new GsonBuilder().create();
+			resultMap = gson.fromJson(jsonResult, GagaMap.class); //access_token
 		} catch (Exception e) {
 			log.error(e.getMessage());
 		}
 		return resultMap;
 	}
 
+	/**
+	 * 카카오 계정 연동해제
+	 *
+	 * @param accessToken - 토근값
+	 * @return GagaMap - snsId 값이 있으면 연동해제 성공
+	 * @author jsshin
+	 * @since 2021. 02. 05
+	 */
 	public GagaMap saveUnlink(String accessToken) {
 		GagaMap resultMap = new GagaMap();
 		try {
@@ -199,12 +272,34 @@ public class KaKaoLogin {
 			String jsonResult = responseEntity.getBody();
 			log.info("responseEntity.getBody(): {} ", jsonResult);
 
-			JsonObject obj = new JsonParser().parse(jsonResult).getAsJsonObject();
-			resultMap.setString("id", obj.get("id").toString());
+			Gson gson = new GsonBuilder().create();
+			JsonObject obj =  gson.fromJson(jsonResult, JsonObject.class);
+
+			resultMap.setString("snsId", obj.get("id").toString());
 
 		} catch (Exception e) {
 			log.error(e.getMessage());
 		}
 		return resultMap;
 	}
+
+	/**
+	 * 국가번호 붙여서 넘겨온 전화번호 변호
+	 * +82) 010 1234 5678 -> 010-1234-5678
+	 * @param cellPhnno - 휴대전화번호
+	 * @param country - 국가
+	 * @return String - 010-1234-5678
+	 * @author jsshin
+	 * @since 2021. 02. 05
+	 */
+	public String getPhoneNumber(String cellPhnno, String country) throws Exception {
+		String result = "";
+		if (StringUtils.isNotBlank(cellPhnno)) {
+			PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
+			Phonenumber.PhoneNumber numberProto = phoneUtil.parse(cellPhnno, "KR");
+			result = phoneUtil.format(numberProto, PhoneNumberUtil.PhoneNumberFormat.NATIONAL);
+		}
+
+		return result;
+	}
 }

+ 28 - 11
src/main/java/com/style24/front/biz/thirdparty/NaverLogin.java

@@ -4,6 +4,8 @@ import java.net.URI;
 
 import javax.annotation.PostConstruct;
 
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
 import com.google.gson.JsonObject;
 import com.google.gson.JsonParser;
 import com.style24.front.support.security.session.TsfSession;
@@ -41,6 +43,8 @@ public class NaverLogin {
 	@Autowired
 	private RestTemplate restTemplate;
 
+	public static final String PROTOCOL = "http://";
+
 	private String callBackUrl;
 	private String clientId;
 	private String clientSecret;
@@ -71,11 +75,18 @@ public class NaverLogin {
 	}
 
 	public String getAuthorizeUrl(String state) {
-		String apiUrl = authorizeUrl;
-		String redirectUri = GagaFileUtil.getConcatenationPath("https://" + TsfSession.getHttpServletRequest().getServerName(), callBackUrl);
-		apiUrl += "?response_type=code&client_id=" + clientId + "&redirect_uri=" + redirectUri + "&state=" + state;
-		log.info("api ===> {}", apiUrl);
-		return apiUrl;
+		StringBuilder apiUrlBuilder = new StringBuilder();
+		String redirectUri = GagaFileUtil.getConcatenationPath(PROTOCOL + TsfSession.getHttpServletRequest().getServerName(), callBackUrl);
+		apiUrlBuilder.append(authorizeUrl)
+				.append("?response_type=code&client_id=")
+				.append(clientId)
+				.append("&redirect_uri=")
+				.append(redirectUri)
+				.append("&state=")
+				.append(state);
+
+		log.info("apiUrlBuilder ===> {}", apiUrlBuilder.toString());
+		return apiUrlBuilder.toString();
 	}
 
 	public GagaMap getAccessTocken(String code, String state) {
@@ -109,11 +120,13 @@ public class NaverLogin {
 			String jsonResult = responseEntity.getBody();
 			log.info("getAccessTocken responseEntity.getBody(): {} ", jsonResult);
 
-			JsonObject obj = new JsonParser().parse(jsonResult).getAsJsonObject();
+			Gson gson = new GsonBuilder().create();
+			JsonObject obj = gson.fromJson(jsonResult, JsonObject.class);
 
 			resultMap.setString("access_token", obj.get("access_token").toString());
 			resultMap.setString("refresh_token", obj.get("refresh_token").toString());
 			resultMap.setString("requestGb", requestGb);
+
 		} catch (Exception e) {
 			log.error(e.getMessage());
 		}
@@ -140,10 +153,11 @@ public class NaverLogin {
 			String jsonResult = responseEntity.getBody();
 			log.info("getNaverUserInfo responseEntity.getBody(): {} ", jsonResult);
 
-			JsonObject obj = new JsonParser().parse(jsonResult).getAsJsonObject();
-			JsonObject response = obj.get("response").getAsJsonObject();
+			Gson gson = new GsonBuilder().create();
+			JsonObject obj = gson.fromJson(jsonResult, JsonObject.class);
+			JsonObject response = gson.fromJson(obj.get("response"), JsonObject.class);
 
-			resultMap.setString("id", response.get("id").toString());
+			resultMap.setString("snsId", response.get("id").toString());
 			resultMap.setString("email", response.get("email").toString());
 
 		} catch (Exception e) {
@@ -175,7 +189,9 @@ public class NaverLogin {
 			String jsonResult = responseEntity.getBody();
 			log.info("getRefreshTocken responseEntity.getBody(): {} ", jsonResult);
 
-			JsonObject obj = new JsonParser().parse(jsonResult).getAsJsonObject();
+			Gson gson = new GsonBuilder().create();
+			JsonObject obj =  gson.fromJson(jsonResult, JsonObject.class);
+
 			resultMap.setString("access_token", obj.get("access_token").toString());
 
 		} catch (Exception e) {
@@ -208,7 +224,8 @@ public class NaverLogin {
 			String jsonResult = responseEntity.getBody();
 			log.info("saveUnlink : responseEntity.getBody(): {} ", jsonResult);
 
-			JsonObject obj = new JsonParser().parse(jsonResult).getAsJsonObject();
+			Gson gson = new GsonBuilder().create();
+			JsonObject obj =  gson.fromJson(jsonResult, JsonObject.class);
 
 			resultMap.setString("access_token", obj.get("access_token").toString());
 			resultMap.setString("result", obj.get("result").toString());

+ 33 - 31
src/main/java/com/style24/front/biz/web/TsfCustomerController.java

@@ -1,22 +1,15 @@
 package com.style24.front.biz.web;
 
 import com.gagaframework.web.parameter.GagaMap;
-import com.gagaframework.web.security.GagaPasswordEncoder;
 import com.style24.core.biz.service.TscClauseService;
 import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.session.TscSession;
 import com.style24.front.biz.service.TsfKakaoService;
-import com.style24.front.biz.service.TsfLoginService;
 import com.style24.front.biz.thirdparty.NiceCertify;
-import com.style24.front.support.env.TsfConstants;
-import com.style24.front.support.security.TsfLoginDetails;
 import com.style24.front.support.security.session.TsfSession;
 import com.style24.persistence.domain.Customer;
-import com.style24.persistence.domain.Login;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.authority.SimpleGrantedAuthority;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -33,9 +26,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import java.util.ArrayList;
-import java.util.List;
+
 
 /**
  * 고객(회원) Controller
@@ -281,11 +272,9 @@ public class TsfCustomerController extends TsfBaseController {
 			return mav;
 		}
 
-		Customer params = new Customer();
-		params.setCustNo(Integer.valueOf(custNo));
-
 		// 고객정보 찾기
-		Customer custInfo = customerService.getCustomerFindId(params);
+		Customer custInfo = customerService.getCustomerFindByCustNo(Integer.valueOf(custNo));
+
 		if (custInfo != null) {
 			mav.addObject("custId", custInfo.getCustId());
 		}
@@ -312,10 +301,9 @@ public class TsfCustomerController extends TsfBaseController {
 			throw new IllegalStateException("고객 정보가 없습니다. 다시 확인 해주세요.");
 		}
 
-		Customer params = new Customer();
-		params.setCustNo(Integer.valueOf(custNo));
 		// 고객정보 찾기
-		Customer custInfo = customerService.getCustomerFindId(params);
+		Customer custInfo = customerService.getCustomerFindByCustNo(Integer.valueOf(custNo));
+
 		if (custInfo != null) {
 			customer.setTempPasswdYn("N"); // 임시비밀번호여부
 			customer.setRegNo(custInfo.getCustNo());
@@ -325,6 +313,7 @@ public class TsfCustomerController extends TsfBaseController {
 			customerService.saveCustomerPassword(customer);
 			isSuccess = true;
 		}
+
 		result.setBoolean("isSuccess", isSuccess);
 		return result;
 	}
@@ -402,7 +391,7 @@ public class TsfCustomerController extends TsfBaseController {
 		ModelAndView mav = new ModelAndView();
 		GagaMap result = niceCertify.certifyCellPhone();
 
-		if (TscConstants.FrontGb.MOBIEL.vale().equals(TsfSession.getFrontGb())) {
+		if (TscConstants.FrontGb.MOBIEL.value().equals(TsfSession.getFrontGb())) {
 			mav.addObject("redirectUrl", redirectUrl); // 모바일만 사용
 		}
 
@@ -424,7 +413,7 @@ public class TsfCustomerController extends TsfBaseController {
 		ModelAndView mav = new ModelAndView();
 		GagaMap result = niceCertify.certifyIpin();
 
-		if (TscConstants.FrontGb.MOBIEL.vale().equals(TsfSession.getFrontGb())) {
+		if (TscConstants.FrontGb.MOBIEL.value().equals(TsfSession.getFrontGb())) {
 			mav.addObject("redirectUrl", redirectUrl); // 모바일만 사용
 		}
 
@@ -459,7 +448,7 @@ public class TsfCustomerController extends TsfBaseController {
 			authMethod = TscConstants.AuthMethod.IPIN.value();
 		}
 
-		if (TscConstants.FrontGb.MOBIEL.vale().equals(TsfSession.getFrontGb())) {
+		if (TscConstants.FrontGb.MOBIEL.value().equals(TsfSession.getFrontGb())) {
 			mav.addObject("redirectUrl", redirectUrl);
 		}
 
@@ -561,7 +550,7 @@ public class TsfCustomerController extends TsfBaseController {
 
 		GagaMap authInfo = niceCertify.getCertifyCellPhoneResultInfo(customer);
 		customer.setCi(authInfo.getString("sCi"));
-		//customer.setCellPhnno(authInfo.getString("sMobileNo"));
+		customer.setCellPhnno(authInfo.getString("sMobileNo"));
 		//customer.setCellPhnno("01025906246");
 
 		if ("N".equals(authInfo.getString("adult"))) {
@@ -581,7 +570,7 @@ public class TsfCustomerController extends TsfBaseController {
 	}
 
 	/**
-	 * 가입
+	 * 가입처리
 	 *
 	 * @param customer - 고객정보
 	 * @return GagaMap - 결과정보
@@ -612,17 +601,30 @@ public class TsfCustomerController extends TsfBaseController {
 
 		// 3.고객정보 생성 및 혜택 처리
 		boolean isJoin = customerService.saveJoinCustomer(customer);
-		// 4.알림톡 및 메일 발송
-		try {
-			if(StringUtils.isNotBlank(customer.getCellPhnno())) {
-				kakaoService.sendJoinCongrat(customer);
-			}
-		} catch (Exception e) {
-			log.error("error", e);
-		}
+
 
 		if (isJoin) {
-			customerService.getLogin(customer.getCustId(),request);
+			// 4.알림톡 발송
+			try {
+				if (StringUtils.isNotBlank(customer.getCellPhnno())) {
+					kakaoService.sendJoinCongrat(customer);
+				}
+			} catch (Exception e) {
+				log.error("error", e);
+			}
+
+			// 5. 이메일 발송
+			try {
+				if (StringUtils.isNotBlank(customer.getEmail())) {
+					// TODO : 2021.02.23 이메일 모듈 개발 필요 jsshin
+				}
+			} catch (Exception e) {
+				log.error("error", e);
+			}
+
+			// 6. 가입성공시 로그인 처리 실패시
+			customerService.getLogin(customer.getCustId(), request);
+
 		} else {
 			TsfSession.setAttribute("maskingCustId",customer.getMaskingCustId());
 		}

+ 151 - 0
src/main/java/com/style24/front/biz/web/TsfIndexController.java

@@ -1,17 +1,30 @@
 package com.style24.front.biz.web;
 
 import java.io.IOException;
+import java.math.BigInteger;
+import java.security.SecureRandom;
 
 import javax.servlet.RequestDispatcher;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.gagaframework.web.parameter.GagaMap;
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import com.style24.core.support.env.TscConstants;
+import com.style24.front.biz.service.TsfCustomerService;
+import com.style24.front.biz.thirdparty.KaKaoLogin;
+import com.style24.front.biz.thirdparty.NaverLogin;
+import com.style24.persistence.domain.CustSnsInfo;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.HttpRequestMethodNotSupportedException;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.servlet.ModelAndView;
 
@@ -39,6 +52,18 @@ public class TsfIndexController extends TsfBaseController {
 	@Autowired
 	private TscMessageByLocale message;
 
+	@Autowired
+	private TsfCustomerService customerService;
+
+	@Autowired
+	private KaKaoLogin kakaoLogin;
+
+	@Autowired
+	private NaverLogin naverLogin;
+
+	@Autowired
+	private ObjectMapper objectMapper;
+
 	/**
 	 * 에러 페이지
 	 * @return
@@ -131,4 +156,130 @@ public class TsfIndexController extends TsfBaseController {
 		return mav;
 	}
 
+	/**
+	 * 카카오 로그인 페이지 호출
+	 *
+	 * @return String
+	 * @author jsshin
+	 * @since 2021. 02. 23
+	 */
+	@GetMapping("/signin/kakologin")
+	public String signinKaKaoLogin(@RequestParam(value = "rememberMe", required = false) String rememberMe, @RequestParam(value = "requestGb", required = false) String requestGb) {
+
+		if (StringUtils.isNotBlank(rememberMe)) {
+			// RememberMe 세션 저장
+			TsfSession.setAttribute("rememberMe", rememberMe);
+		}
+		// CSRF 방지를 위한 상태 토큰 생성 코드
+		SecureRandom random = new SecureRandom();
+		String state = new BigInteger(130, random).toString(32);
+		state += "!@!" + requestGb;
+		TsfSession.setAttribute("state", state);
+
+		String redirectUrl = kakaoLogin.getAuthorizeUrl(state);
+
+		return "redirect:" + redirectUrl;
+	}
+
+	/**
+	 * 네이버 로그인 페이지 호출
+	 *
+	 * @return String
+	 * @author jsshin
+	 * @since 2020. 5. 25
+	 */
+	@GetMapping("/signin/naverlogin")
+	public String signinNaverLogin(@RequestParam(value = "rememberMe", required = false) String rememberMe, @RequestParam(value = "requestGb", required = false) String requestGb) {
+
+		if (StringUtils.isNotBlank(rememberMe)) {
+			// RememberMe 세션 저장
+			TsfSession.setAttribute("rememberMe", rememberMe);
+		}
+		// CSRF 방지를 위한 상태 토큰 생성 코드
+		SecureRandom random = new SecureRandom();
+		String state = new BigInteger(130, random).toString(32);
+		state += "!@!" + requestGb;
+		TsfSession.setAttribute("state", state);
+
+		String redirectUrl = naverLogin.getAuthorizeUrl(state);
+
+		return "redirect:" + redirectUrl;
+	}
+
+
+	/**
+	 * SNS 로그인
+	 *
+	 * @param session - HttpSession
+	 * @param snsType - SNS유형(NV:네이버, KK:카카오)
+	 * @return ModelAndView
+	 * @author jsshin
+	 * @since 2021. 02. 23
+	 */
+	@RequestMapping("/signin/snsLoginCallback")
+	public ModelAndView signinSnsLoginCallback(@RequestParam(value = "snsType", required = false) String snsType, HttpSession session
+			, @RequestParam(value = "code", required = false) String code, @RequestParam(value = "state", required = false) String state
+			, @RequestParam(value = "error", required = false) boolean isError) {
+
+		ModelAndView mav = new ModelAndView();
+
+		log.info("isError: {}", isError);
+
+		if (isError) {
+			Exception ex = (Exception)session.getAttribute("SPRING_SECURITY_LAST_EXCEPTION");
+			log.debug("e.getMessage(): {}", ex.getMessage());
+			mav.addObject("error", ex.getMessage());
+		}
+
+		GagaMap userInfo = new GagaMap();
+		boolean isSnsLoing = false;
+		if (StringUtils.isNotBlank(code) && TscConstants.SnsType.KAKAO.value().equals(snsType)) {
+			String sessionState = TsfSession.getAttribute("state");
+			if (sessionState.equals(state)) {
+				GagaMap tokenInfo = kakaoLogin.getAccessTocken(code, state);
+				userInfo = kakaoLogin.getKakaoUserInfo(tokenInfo.getString("access_token"));
+				userInfo.setString("accessToken", tokenInfo.getString("access_token"));
+				userInfo.setString("refreshToken", tokenInfo.getString("refresh_token"));
+				userInfo.setString("snsType", snsType);
+				userInfo.setString("requestGb", tokenInfo.getString("requestGb"));
+				isSnsLoing = true;
+			}
+		}
+
+		if (StringUtils.isNotBlank(code) && TscConstants.SnsType.NAVER.value().equals(snsType)) {
+			String sessionState = TsfSession.getAttribute("state");
+			if (sessionState.equals(state)) {
+				GagaMap tokenInfo = naverLogin.getAccessTocken(code, state);
+				userInfo = naverLogin.getNaverUserInfo(tokenInfo.getString("access_token"));
+				userInfo.setString("accessToken", tokenInfo.getString("access_token"));
+				userInfo.setString("refreshToken", tokenInfo.getString("refresh_token"));
+				userInfo.setString("snsType", snsType);
+				userInfo.setString("requestGb", tokenInfo.getString("requestGb"));
+				isSnsLoing = true;
+			}
+		}
+
+		// SNS 로그인 성공시 정보 세션 저장
+		GagaMap resultMap = new GagaMap();
+		if (isSnsLoing) {
+			CustSnsInfo custSnsInfo = objectMapper.convertValue(userInfo, CustSnsInfo.class);
+			//상태 체크
+			resultMap = customerService.customerSnsProcessing(custSnsInfo);
+
+		}
+
+		// RememberMe 값이 있고 true이면
+		if (StringUtils.isNotBlank(TsfSession.getAttribute("rememberMe")) && Boolean.valueOf(TsfSession.getAttribute("rememberMe"))) {
+			userInfo.setBoolean("rememberMe", true);
+		}
+
+		mav.addObject("resultMap", resultMap);
+		mav.addObject("snsId", userInfo.getString("snsId"));
+		mav.addObject("snsType", snsType);
+
+		mav.setViewName(super.getDeviceViewName("SnsCallBackForm"));
+
+		return mav;
+	}
+
 }

+ 38 - 0
src/main/java/com/style24/persistence/domain/CustSnsInfo.java

@@ -0,0 +1,38 @@
+package com.style24.persistence.domain;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.style24.persistence.TscBaseDomain;
+import lombok.Data;
+
+/**
+ * 고객 Sns 정보 Domain
+ * @JsonSerialize 애노테이션을 지정해야 세션을 레디스에 저장할 수 있다.
+ * @author jsshin
+ * @since 2021. 02. 24
+ */
+@SuppressWarnings("serial")
+@Data
+@JsonSerialize
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class CustSnsInfo extends TscBaseDomain {
+
+	// 세션을 JSON 형식으로 레디스에 저장하려면 기본 생성자를 반드시 명시해야 한다
+	public CustSnsInfo (){
+
+	}
+	private String snsId;
+	private String snsType;
+	private String accessToken;
+	private String refreshToken;
+	private String custNm;
+	private String email;
+	private String ci;
+	private String cellPhnno;
+	private String birthYmd;
+	private String birthSm;
+	private String sexGb;
+	private Integer custNo;
+
+	private String requestGb;
+}

+ 69 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfCustomer.xml

@@ -264,4 +264,73 @@
 		)
 	</insert>
 
+	<select id="getCusomterActiveAndDormant" parameterType="Customer" resultType="Customer">
+		/* TsfCustomer.getCusomterActiveAndDormant */
+		SELECT CUST_NO
+		     , CUST_ID
+		     , EMAIL
+		     , CELL_PHNNO
+		     , CUST_STAT
+		     , DATE_FORMAT(JOIN_DT, '%Y%m%d%H%i%S')   AS JOIN_DT
+		     , ''                                     AS DORMANT_DT
+		FROM   TB_CUSTOMER
+		WHERE  CUST_STAT = 'G104_10'
+		<if test="custId != null and custId !=''">
+		AND    CUST_ID = #{custId}
+		</if>
+		<if test="encodedCustNm != null and encodedCustNm != ''">
+		AND    CUST_NM = #{encodedCustNm}
+		</if>
+		<if test="encodedEmail != null and encodedEmail != ''">
+		AND    EMAIL = #{encodedEmail}
+		</if>
+		<if test="encodedBirthYmd != null and encodedBirthYmd != ''">
+		AND    BIRTH_YMD = #{encodedBirthYmd}
+		</if>
+		<if test="ci != null and ci != ''">
+		AND    CI = #{ci}
+		</if>
+		UNION ALL
+		SELECT CUST_NO
+		     , CUST_ID
+		     , EMAIL
+		     , CELL_PHNNO
+		     , CUST_STAT
+		     , ''                                      AS JOIN_DT
+		     , DATE_FORMAT(DORMANT_DT, '%Y%m%d%H%i%S') AS DORMANT_DT
+		FROM   TB_DORMANT_CUST
+		WHERE  1 = 1
+		<if test="custId != null and custId !=''">
+		AND    CUST_ID = #{custId}
+		</if>
+		<if test="encodedCustNm != null and encodedCustNm != ''">
+		AND    CUST_NM = #{encodedCustNm}
+		</if>
+		<if test="encodedEmail != null and encodedEmail != ''">
+		AND    EMAIL = #{encodedEmail}
+		</if>
+		<if test="encodedBirthYmd != null and encodedBirthYmd != ''">
+		AND    BIRTH_YMD = #{encodedBirthYmd}
+		</if>
+		<if test="ci != null and ci != ''">
+		AND    CI = #{ci}
+		</if>
+	</select>
+
+	<select id="getCusomterSnsFind" parameterType="CustSnsInfo" resultType="Customer">
+		SELECT C.CUST_NO
+		     , C.CUST_ID
+		     , C.CUST_NM
+		     , C.CELL_PHNNO
+		     , C.EMAIL
+		     , C.CUST_STAT
+		     , C.CI
+		FROM   TB_CUSTOMER C
+		LEFT JOIN
+		       TB_CUSTOMER_SNS CS
+		ON     C.CUST_NO = CS.CUST_NO
+		WHERE  CS.SNS_TYPE = #{snsType}
+		AND    CS.SNS_ID = #{snsId}
+	</select>
+
 </mapper>

+ 14 - 14
src/main/resources/config/application.yml

@@ -48,20 +48,20 @@ naver:
 
 #카카오 API
 kakao:
-#    appId: 442702
-#    appName: 아이스타일24
-#    companyName: 예스이십사
-#    nativeAppKey: 5d97db2ee36fa0e121d962b2531ae0c1
-#    restApiKey: 46d601394bd887cbada3cf00fdddef54
-#    javascriptKey: b3c9ee69171042c3637e8d714a4c8a75
-#    adminKey: 7cc33b2ef96d785c4caf3376f9dc9254
-    appId : 399207
-    appName : 구축용 테스트앱
-    companyName : 예스이십사
-    nativeAppKey : f961e612e07b47aa2d1884714518a194
-    restApiKey: b3955cef0328a09156c7e25f18552164
-    javascriptKey : 06cab652ad5d25be2190388d11a88fa4
-    adminKey : a25ca74dde640f3a63a8d8442fe35fcd
+    appId: 442702
+    appName: 아이스타일24
+    companyName: 예스이십사
+    nativeAppKey: 5d97db2ee36fa0e121d962b2531ae0c1
+    restApiKey: 46d601394bd887cbada3cf00fdddef54
+    javascriptKey: b3c9ee69171042c3637e8d714a4c8a75
+    adminKey: 7cc33b2ef96d785c4caf3376f9dc9254
+#    appId : 399207
+#    appName : 구축용 테스트앱
+#    companyName : 예스이십사
+#    nativeAppKey : f961e612e07b47aa2d1884714518a194
+#    restApiKey: b3955cef0328a09156c7e25f18552164
+#    javascriptKey : 06cab652ad5d25be2190388d11a88fa4
+#    adminKey : a25ca74dde640f3a63a8d8442fe35fcd
     addressApiRequestUrl : https://dapi.kakao.com/v2/local/search/address.json?page=1&query=
     login.callbackUrl: /signin/snsLoginCallback?snsType=KK
     tokenUrl: https://kauth.kakao.com/oauth/token

+ 31 - 16
src/main/webapp/WEB-INF/views/web/SigninFormWeb.html

@@ -95,13 +95,13 @@
 							<h5 class="sr-only">간편로그인</h5>
 							<ul>
 								<li>
-									<a href="javascript:void(0)">
+									<a href="javascript:void(0)" onclick="cfnLoginKakao();">
 										<i class="ico ico_snslogin kakao"></i>
 										<span>카카오로 시작하기</span>
 									</a>
 								</li>
 								<li>
-									<a href="javascript:void(0)">
+									<a href="javascript:void(0)" onclick="cfnLoginNaver();">
 										<i class="ico ico_snslogin naver"></i>
 										<span>네이버로 시작하기</span>
 									</a>
@@ -230,23 +230,38 @@
 	let fnReloadCaptchaImage = function() {
 		$('#imgCaptcha').attr('src', '/common/captcha.do?dummy=' + new Date());
 	}
-	
-	// 카카오 로그인
-	var fnLoginKakao = function() {
-		document.location.href = _frontUrl + '/signin/kakologin';
-	};
-	
-	// 네이버 로그인
-	var fnLoginNaver = function() {
-		document.location.href = _frontUrl + '/signin/naverlogin';
+
+	// SNS 로그인 콜백함수
+	var fnSnsSigninCallback = function(userInfo) {
+		console.log('userInfo', userInfo);
+		let params = {};
+		params.snsType = userInfo.snsType;
+		params.snsJoinId = [[${snsLoginPrefix}]] + userInfo.snsId;
+		// $.post(_frontUrl + '/login'
+		// 	, $.param(params)
+		// 	, function(result) {
+		// 		fnReloadAfterLogin(result);
+		// 	}
+		// 	, "json");
 	};
-	
-	// YES24 로그인
-	var fnLoginYes24 = function() {
-		document.location.href = _frontUrl + '/signin/yes24login';
+
+	var fnReloadAfterLogin = function(result) {
+		if (result.status === 'OK') {
+			document.location.href = result.returnUrl;
+		} else if (result.status === 'EMAIL_DUP') {
+
+		} else if(result.status === 'DORMANT_CUST') {
+			cfnGoToPage(_PAGE_CUSTOMER_DORMANT);
+		} else if(result.status === 'SECEDE_CUST') {
+
+		} else {
+			//cfnGoToPage(_PAGE_CUSTOMER_JOIN_CERTIFY_SNS);
+		}
 	};
 
-	$(document).ready(function() {
+
+
+$(document).ready(function() {
 		$('#loginForm input[name=loginId]').val(gagajf.getCookie(ckLoginId));
 		if (gagajf.isNull($('#loginForm input[name=loginId]').val())) {
 			$('#loginForm input[name=loginId]').focus();

+ 48 - 0
src/main/webapp/WEB-INF/views/web/SnsCallBackFormWeb.html

@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org">
+<!--
+ *******************************************************************************
+ * @source  : SigninFormWeb.html
+ * @desc    : 로그인 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2020 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.02.15   gagamel     최초 작성
+ *******************************************************************************
+ -->
+<head th:replace="~{web/common/fragments/HeadWeb :: head}"></head>
+<th:block th:replace="~{web/common/fragments/VariablesWeb :: variables}"></th:block>
+<th:block th:replace="~{web/common/fragments/ScriptsWeb :: scripts}"></th:block>
+<body>
+
+
+<script th:inline="javascript">
+/*<![CDATA[*/
+	const snsType = [[${snsType}]];
+	const snsId = [[${snsId}]];
+
+	if (snsType === 'KK') {
+		if (gagajf.isNull(snsId)){
+			mcxDialog.alertC("인증에 실패하였습니다.<br> 로그인 정보를 확인해주시기 바랍니다.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					self.close();
+				}
+			});
+		} else {
+			opener.fnSnsSigninCallback(snsId);
+			self.close();
+		}
+	}
+
+
+/*]]>*/
+</script>
+
+
+</body>
+</html>

+ 55 - 2
src/main/webapp/ux/style24_link.js

@@ -58,7 +58,7 @@ const _PAGE_NOTICE = _frontUrl + "/callcenter/notice/form";								// 고객센
  * @access : public
  * @desc   : page 이동
  * <pre>
- *		 cfnGoToPage(PAGE_LOGIN);
+ *     cfnGoToPage(PAGE_LOGIN);
  * </pre>
  * @param  : page - page
  * @return : None
@@ -179,7 +179,7 @@ var cfnOpenIpinCertify = function (redirectUrl) {
  */
 function cfnAddCart(cartList) {
 	let jsonData = JSON.stringify(cartList);
-	
+
 	$.ajax( {
 		type: "POST",
 		url : '/cart/save',
@@ -191,3 +191,56 @@ function cfnAddCart(cartList) {
 		}
 	});
 }
+
+
+/**
+ * @type   : function
+ * @access : public
+ * @desc   :  네이버 로그인
+ * <pre>
+ *     cfnLoginNaver();
+ *     호출된 페이지에서
+ *     PC: fnSnsSigninCallback(userInfo) 콜백 함수 생성 후 가지고 호출 처리
+ *     MO :
+ * </pre>
+ * @since  : 2021/02/23
+ * @author : jsshin
+ */
+var cfnLoginNaver = function (requestGb, chkRememberMe) {
+	var actionUrl = _frontUrl + '/signin/naverlogin?rememberMe=' + chkRememberMe;
+	var popupHeight = 800;
+	var popupWidth = 600;
+	var popupX = (window.screen.width / 2) - (popupWidth / 2);
+	var popupY = (window.screen.height / 3) - (popupHeight / 3);
+	if ('P' === _frontGb) {
+		window.open(actionUrl, 'naverLogin', 'top=' + popupY + ',left=' + popupX + ',height=' + popupHeight + ',width=' + popupWidth + ', fullscreen=no,menubar=no,status=no,toolbar=no,titlebar=yes,location=no,scrollbars=yes', '');
+	} else {
+		document.location.href = actionUrl + '&requestGb=' + requestGb;
+	}
+};
+
+/**
+ * @type   : function
+ * @access : public
+ * @desc   : 카카오 로그인
+ * <pre>
+ *     cfnLoginKakao();
+ *     호출된 페이지에서
+ *     PC: fnSnsSigninCallback(userInfo) 콜백 함수 생성 후 가지고 호출 처리
+ *     MO :
+ * </pre>
+ * @since  : 2021/02/23
+ * @author : jsshin
+ */
+var cfnLoginKakao = function (requestGb, chkRememberMe) {
+	var actionUrl = _frontUrl + '/signin/kakologin?rememberMe=' + chkRememberMe;
+	var popupWidth = 450;
+	var popupHeight = 700;
+	var popupX = (window.screen.width / 2) - (popupWidth / 2);
+	var popupY = (window.screen.height / 3) - (popupHeight / 3);
+	if ('P' === _frontGb) {
+		window.open(actionUrl, 'kakaoLogin', 'top=' + popupY + ',left=' + popupX + ',height=' + popupHeight + ',width=' + popupWidth + ', fullscreen=no,menubar=no,status=no,toolbar=no,titlebar=yes,location=no,scrollbars=yes', '');
+	} else {
+		document.location.href = actionUrl + '&requestGb=' + requestGb;
+	}
+};