This commit is contained in:
hyunho 2020-11-27 01:29:23 +00:00
parent 44f482dd80
commit 1f0afe819b
4 changed files with 44 additions and 22 deletions

View File

@ -83,21 +83,7 @@
}
snsInit();
});
var gauth;
function googleInit() {
gapi.load('auth2', function () {
var gauth = gapi.auth2.init({
client_id: "@googleClientId",
scope: 'profile'
});
gauth.then(function () {
console.log('google init success');
}, function () {
console.error('google init fail');
})
});
}
function login() {
if (val("uid") != "" && val("upw") != "") {
capp("/focommon/login", { uid: val("uid"), upw: val("upw"), issaveid: $("#issaveid").prop("checked") }, "cblogin");
@ -122,6 +108,23 @@
}
} else { msg("입력하신 아이디/비밀번호와 일치하는 계정이 없습니다. 다시 확인해주세요."); }
}
var gauth;
function googleInit() {
gapi.load('auth2', function () {
var gauth = gapi.auth2.init({
client_id: "@googleClientId",
scope: 'profile'
});
gauth.then(function () {
console.log('google init success');
}, function () {
console.error('google init fail');
})
});
}
var naverLogin = new naver.LoginWithNaverId(
{
clientId: "@naverClientId",

View File

@ -273,9 +273,7 @@ else
$("#email").prop("readonly", "readonly");
$("#email").css("background-color", "#ddd");
} else {
alert("callback 처리에 실패하였습니다. 관리자에게 문의하세요. error status[" + status + "]");
history.back(-1);
return;
alert("네이버 AccessToken이 올바르지 않습니다. 관리자에게 문의하세요. error status[" + status + "]");
}
});
}

View File

@ -50,7 +50,7 @@
//0:일반회원가입,1:google,2:naver,3:kakao
capp("/focommon/CheckExistSnsId", { snsid: uniqId, jointype: 2 }, "snslogin");
} else {
console.log("callback 처리에 실패하였습니다.");
alert("네이버 AccessToken이 올바르지 않습니다. 관리자에게 문의하세요. error status[" + status + "]");
}
});
});

View File

@ -1,12 +1,33 @@
@{
Layout = null;
@Html.Partial("./Partial/JS")
var naverClientId = ViewBag.naverClientID;
}
<head>
@Html.Partial("./Partial/JS")
<script type="text/javascript" src="/js/naveridlogin_js_sdk_2.0.0.js"></script>
</head>
<script>
$(document).ready(function () {
$.when(
naverLogin.init()
).done(function () {
opener.location.href = "https://www.ynicte.com/Account/Join?jointype=2";
self.close();
});
});
var naverLogin = new naver.LoginWithNaverId(
{
clientId: "@naverClientId",
callbackUrl: "https://www.ynicte.com/Account/NaverCallbackJoin",
isPopup: false,
callbackHandle: true
}
);
</script>