jsshin 5 anos atrás
pai
commit
1557c5ac94

+ 14 - 3
src/main/java/com/style24/front/biz/thirdparty/KaKaoLogin.java

@@ -12,6 +12,7 @@ import com.style24.front.support.security.session.TsfSession;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.core.env.Environment;
 import org.springframework.core.env.Environment;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpHeaders;
@@ -43,7 +44,8 @@ public class KaKaoLogin {
 	@Autowired
 	@Autowired
 	private RestTemplate restTemplate;
 	private RestTemplate restTemplate;
 
 
-	public static final String PROTOCOL = "http://";
+	@Value("${has-ssl}")
+	private String hasSsl;
 
 
 	private String callBackUrl;
 	private String callBackUrl;
 	private String restApiKey;
 	private String restApiKey;
@@ -52,6 +54,7 @@ public class KaKaoLogin {
 	private String userInfoUrl;
 	private String userInfoUrl;
 	private String authorizeUrl;
 	private String authorizeUrl;
 	private String unlinkUrl;
 	private String unlinkUrl;
+	private String protocal;
 
 
 	@PostConstruct
 	@PostConstruct
 	public void init() {
 	public void init() {
@@ -63,6 +66,14 @@ public class KaKaoLogin {
 		authorizeUrl = env.getProperty("kakao.authorizeUrl");
 		authorizeUrl = env.getProperty("kakao.authorizeUrl");
 		unlinkUrl = env.getProperty("kakao.unlinkUrl");
 		unlinkUrl = env.getProperty("kakao.unlinkUrl");
 
 
+		boolean isSslServer = Boolean.parseBoolean(hasSsl);
+
+		if (isSslServer) {
+			protocal = "https://";
+		} else {
+			protocal = "http://";
+		}
+
 		log.debug("\n\n---- Kakao initialization started ----");
 		log.debug("\n\n---- Kakao initialization started ----");
 		log.debug("callBackUrl: [{}]", callBackUrl);
 		log.debug("callBackUrl: [{}]", callBackUrl);
 		log.debug("restApiKey: [{}]", restApiKey);
 		log.debug("restApiKey: [{}]", restApiKey);
@@ -82,7 +93,7 @@ public class KaKaoLogin {
 	 */
 	 */
 	public String getAuthorizeUrl(String state) {
 	public String getAuthorizeUrl(String state) {
 		StringBuilder apiUrlBuilder = new StringBuilder();
 		StringBuilder apiUrlBuilder = new StringBuilder();
-		String redirectUri = GagaFileUtil.getConcatenationPath(PROTOCOL + TsfSession.getHttpServletRequest().getServerName(), callBackUrl);
+		String redirectUri = GagaFileUtil.getConcatenationPath(protocal + TsfSession.getHttpServletRequest().getServerName(), callBackUrl);
 		apiUrlBuilder.append(authorizeUrl)
 		apiUrlBuilder.append(authorizeUrl)
 				.append("?client_id=")
 				.append("?client_id=")
 				.append(restApiKey)
 				.append(restApiKey)
@@ -105,7 +116,7 @@ public class KaKaoLogin {
 	 */
 	 */
 	public GagaMap getAccessTocken(String code, String state) {
 	public GagaMap getAccessTocken(String code, String state) {
 		GagaMap resultMap = new GagaMap();
 		GagaMap resultMap = new GagaMap();
-		String redirectUri = GagaFileUtil.getConcatenationPath(PROTOCOL + TsfSession.getHttpServletRequest().getServerName(), callBackUrl);
+		String redirectUri = GagaFileUtil.getConcatenationPath(protocal + TsfSession.getHttpServletRequest().getServerName(), callBackUrl);
 		String requestGb = "";
 		String requestGb = "";
 		try {
 		try {
 			MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
 			MultiValueMap<String, String> params = new LinkedMultiValueMap<>();

+ 13 - 2
src/main/java/com/style24/front/biz/thirdparty/NaverLogin.java

@@ -10,6 +10,7 @@ import com.style24.front.support.security.session.TsfSession;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.core.env.Environment;
 import org.springframework.core.env.Environment;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpHeaders;
@@ -40,7 +41,8 @@ public class NaverLogin {
 	@Autowired
 	@Autowired
 	private RestTemplate restTemplate;
 	private RestTemplate restTemplate;
 
 
-	public static final String PROTOCOL = "http://";
+	@Value("${has-ssl}")
+	private String hasSsl;
 
 
 	private String callBackUrl;
 	private String callBackUrl;
 	private String clientId;
 	private String clientId;
@@ -49,6 +51,8 @@ public class NaverLogin {
 	private String tokenUrl;
 	private String tokenUrl;
 	private String userInfoUrl;
 	private String userInfoUrl;
 	private String authorizeUrl;
 	private String authorizeUrl;
+	private String protocal;
+
 
 
 	@PostConstruct
 	@PostConstruct
 	public void init() {
 	public void init() {
@@ -60,6 +64,13 @@ public class NaverLogin {
 		userInfoUrl = env.getProperty("naver.userInfoUrl");
 		userInfoUrl = env.getProperty("naver.userInfoUrl");
 		authorizeUrl = env.getProperty("naver.authorizeUrl");
 		authorizeUrl = env.getProperty("naver.authorizeUrl");
 
 
+		boolean isSslServer = Boolean.parseBoolean(hasSsl);
+		if (isSslServer) {
+			protocal = "https://";
+		} else {
+			protocal = "http://";
+		}
+
 		log.debug("\n\n---- Naver initialization started ----");
 		log.debug("\n\n---- Naver initialization started ----");
 		log.debug("callBackUrl: [{}]", callBackUrl);
 		log.debug("callBackUrl: [{}]", callBackUrl);
 		log.debug("clientId: [{}]", clientId);
 		log.debug("clientId: [{}]", clientId);
@@ -73,7 +84,7 @@ public class NaverLogin {
 
 
 	public String getAuthorizeUrl(String state) {
 	public String getAuthorizeUrl(String state) {
 		StringBuilder apiUrlBuilder = new StringBuilder();
 		StringBuilder apiUrlBuilder = new StringBuilder();
-		String redirectUri = GagaFileUtil.getConcatenationPath(PROTOCOL + TsfSession.getHttpServletRequest().getServerName(), callBackUrl);
+		String redirectUri = GagaFileUtil.getConcatenationPath(protocal + TsfSession.getHttpServletRequest().getServerName(), callBackUrl);
 		apiUrlBuilder.append(authorizeUrl)
 		apiUrlBuilder.append(authorizeUrl)
 				.append("?response_type=code&client_id=")
 				.append("?response_type=code&client_id=")
 				.append(clientId)
 				.append(clientId)

+ 14 - 2
src/main/java/com/style24/front/biz/thirdparty/Yes24Login.java

@@ -12,6 +12,7 @@ import com.style24.persistence.domain.CustSnsInfo;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.core.env.Environment;
 import org.springframework.core.env.Environment;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
 import org.springframework.http.HttpHeaders;
@@ -48,7 +49,9 @@ public class Yes24Login {
 	@Autowired
 	@Autowired
 	private RestTemplate restTemplate;
 	private RestTemplate restTemplate;
 
 
-	public static final String PROTOCOL = "http://";
+	@Value("${has-ssl}")
+	private String hasSsl;
+
 
 
 	private String id;
 	private String id;
 	private String type;
 	private String type;
@@ -58,6 +61,7 @@ public class Yes24Login {
 	private String userInfoUrl;
 	private String userInfoUrl;
 	private String linkUrl;
 	private String linkUrl;
 	private String unlinkUrl;
 	private String unlinkUrl;
+	private String protocal;
 
 
 	@PostConstruct
 	@PostConstruct
 	public void init() {
 	public void init() {
@@ -70,6 +74,14 @@ public class Yes24Login {
 		linkUrl = env.getProperty("yes24.linkUrl");
 		linkUrl = env.getProperty("yes24.linkUrl");
 		unlinkUrl = env.getProperty("yes24.unlinkUrl");
 		unlinkUrl = env.getProperty("yes24.unlinkUrl");
 
 
+		boolean isSslServer = Boolean.parseBoolean(hasSsl);
+
+		if (isSslServer) {
+			protocal = "https://";
+		} else {
+			protocal = "http://";
+		}
+
 		log.debug("\n\n---- YES24 initialization started ----");
 		log.debug("\n\n---- YES24 initialization started ----");
 		log.debug("id: [{}]", id);
 		log.debug("id: [{}]", id);
 		log.debug("type: [{}]", type);
 		log.debug("type: [{}]", type);
@@ -93,7 +105,7 @@ public class Yes24Login {
 		String idGb = TsfSession.getFrontGb().equals("P") ? "PID" : "MID";
 		String idGb = TsfSession.getFrontGb().equals("P") ? "PID" : "MID";
 		String requestUrl = TsfSession.getFrontGb().equals("P") ? webRequestUrl : mobRequestUrl;
 		String requestUrl = TsfSession.getFrontGb().equals("P") ? webRequestUrl : mobRequestUrl;
 		StringBuilder apiUrlBuilder = new StringBuilder();
 		StringBuilder apiUrlBuilder = new StringBuilder();
-		String redirectUri = GagaFileUtil.getConcatenationPath(PROTOCOL + TsfSession.getHttpServletRequest().getServerName(), callBackUrl);
+		String redirectUri = GagaFileUtil.getConcatenationPath(protocal + TsfSession.getHttpServletRequest().getServerName(), callBackUrl);
 		apiUrlBuilder.append(requestUrl)
 		apiUrlBuilder.append(requestUrl)
 				.append("?")
 				.append("?")
 				.append(idGb)
 				.append(idGb)

+ 2 - 1
src/main/webapp/WEB-INF/views/mob/mypage/MypageCustConfirmFormMob.html

@@ -94,13 +94,14 @@
 	var fnConfirmCallback = function (result) {
 	var fnConfirmCallback = function (result) {
 		let confirmYn = 'Y';
 		let confirmYn = 'Y';
 		let $passwd = $('#confirmForm input[name=passwd]');
 		let $passwd = $('#confirmForm input[name=passwd]');
+		let $custId = $('#confirmForm input[name=custId]');
 		if (result.isMatch) {
 		if (result.isMatch) {
 			confirmYn = 'Y';
 			confirmYn = 'Y';
 			cfnGoToPage(_PAGE_MYPAGE_CUSTOMER_MODIFY+'?confirmYn='+ confirmYn);
 			cfnGoToPage(_PAGE_MYPAGE_CUSTOMER_MODIFY+'?confirmYn='+ confirmYn);
 		} else {
 		} else {
 			mcxDialog.alert('비밀번호가 일치하지 않습니다.');
 			mcxDialog.alert('비밀번호가 일치하지 않습니다.');
 			$passwd.val('');
 			$passwd.val('');
-			$passwd.focus();
+			$custId.focus();
 			return;
 			return;
 		}
 		}
 	};
 	};

+ 6 - 3
src/main/webapp/WEB-INF/views/mob/mypage/MypageCustModifyFormMob.html

@@ -248,6 +248,9 @@
 		fnDisplayEmailAgree(custInfo.emailAgreeYn);
 		fnDisplayEmailAgree(custInfo.emailAgreeYn);
 		fnDisplaySmsAgree(custInfo.smsAgreeYn);
 		fnDisplaySmsAgree(custInfo.smsAgreeYn);
 
 
+		// 회원(고객) 계좌 조회
+		fnGetCustAccountInfo();
+
 	}
 	}
 
 
 	// 이메일 수신동의
 	// 이메일 수신동의
@@ -517,6 +520,7 @@
 	});
 	});
 
 
 	$(document).ready(function(){
 	$(document).ready(function(){
+
 		if (!gagajf.isNull(sEncData)) {
 		if (!gagajf.isNull(sEncData)) {
 			fnNiceCallBack(sEncData, authMethod);
 			fnNiceCallBack(sEncData, authMethod);
 		}
 		}
@@ -526,9 +530,6 @@
 		// 회원(고객) 조회
 		// 회원(고객) 조회
 		fnGetCustInfo();
 		fnGetCustInfo();
 
 
-		// 회원(고객) 계좌 조회
-		fnGetCustAccountInfo();
-
 		//버튼 색
 		//버튼 색
 		$(document).on('click','.popup_box .button_list button',function(){
 		$(document).on('click','.popup_box .button_list button',function(){
 			$('.popup_box .button_list button').removeClass('on');
 			$('.popup_box .button_list button').removeClass('on');
@@ -549,6 +550,8 @@
 			$("body").css({"overflow":"visible"});
 			$("body").css({"overflow":"visible"});
 		});
 		});
 
 
+
+
 	})
 	})
 	/*]]>*/
 	/*]]>*/
 </script>
 </script>