YNICTE/FO/Views/Account/GoogleCallback.cshtml

46 lines
1.5 KiB
Plaintext
Raw Normal View History

2020-11-27 09:31:40 +09:00
@{
Layout = null;
var naverClientId = ViewBag.naverClientID;
var kakaoClientId = ViewBag.kakaoClientID;
var googleClientId = ViewBag.googleClientID;
}
<head>
@Html.Partial("./Partial/JS")
<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="@googleClientId">
</head>
<div class="g-signin2" data-onsuccess="onGoogleLogIn" style="display:none"></div> @*구글로그인관련*@
<script>
var snsid;
function onGoogleLogIn(googleUser) {
var profile = googleUser.getBasicProfile();
snsid = profile.getId();
capp("/focommon/CheckExistSnsId", { snsid: snsid, jointype: 1 }, "snslogin");
}
function snslogin() {
if (capResult.code > 0) {
capp("/focommon/SnsLogin", { uid: snsid, isSns: true }, "goHome()");
}
else {
2020-12-28 14:49:31 +09:00
if (confirm("구글과 연동된 회원정보가 존재하지 않습니다.\r\n일반 로그인 후 SNS ID와 연동 기능을 이용하세요.")) {
2020-11-27 09:31:40 +09:00
goJoin();
}
else {
goIndex();
}
}
}
function goJoin() {
2020-12-16 13:42:03 +09:00
location.href = "/Account/Join?jointype=1";
2020-11-27 09:31:40 +09:00
}
function goHome() {
2020-11-27 13:55:01 +09:00
if (capResult.code > 0) {
2020-12-21 08:37:18 +09:00
location.href = "https://cte.nptc.kr";
2020-11-27 13:55:01 +09:00
}
2020-11-27 09:31:40 +09:00
}
function goIndex() {
2020-12-16 13:42:03 +09:00
location.href = "/Account/Index";
2020-11-27 09:31:40 +09:00
}
</script>