87 lines
2.8 KiB
Plaintext
87 lines
2.8 KiB
Plaintext
@{
|
|
var naverClientId = ViewBag.naverClientID;
|
|
var kakaoClientId = ViewBag.kakaoClientID;
|
|
var googleClientId = ViewBag.googleClientID;
|
|
}
|
|
<head>
|
|
<script type="text/javascript" src="/js/naveridlogin_js_sdk_2.0.0.js"></script>
|
|
<script type="text/javascript" src="/js/kakao.js"></script>
|
|
<script src="https://apis.google.com/js/platform.js?onload=googleInit" async defer></script>
|
|
</head>
|
|
<form id="mform" method="post">
|
|
<div class="jnSns">
|
|
<a href="#" onclick="javascript: $('#mform').attr('action', '/Account/JoinIdVeri').submit();">영남건설 기술 교육원 홈페이지 회원가입</a>
|
|
<div id="naverIdLogin" style="display:none"></div>
|
|
<ul class="lgnSns">
|
|
<li>
|
|
<a href="javascript:loginWithNaver()">네이버 아이디로 회원가입</a>
|
|
</li>
|
|
<li>
|
|
<a href="javascript:loginWithKakao()">카카오 아이디로 회원가입</a>
|
|
</li>
|
|
<li>
|
|
<a href="javascript:loginWithGoogle()">구글 아이디로 회원가입</a>
|
|
</li>
|
|
</ul>
|
|
|
|
</div>
|
|
</form>
|
|
|
|
|
|
<script>
|
|
$(document).ready(function () {
|
|
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');
|
|
})
|
|
});
|
|
}
|
|
|
|
|
|
var naverLogin = new naver.LoginWithNaverId(
|
|
{
|
|
clientId: "@naverClientId",
|
|
callbackUrl: "https://www.ynicte.com/Account/NaverCallbackJoin",
|
|
isPopup: true,
|
|
loginButton: { color: "green", type: 3, height: 60 }
|
|
}
|
|
);
|
|
|
|
function loginWithKakao() {
|
|
Kakao.Auth.login({
|
|
success: function (authObj) {
|
|
location.href = "https://www.ynicte.com/Account/Join?jointype=3";
|
|
},
|
|
fail: function (err) {
|
|
alert("카카오 아이디로 회원가입에 실패했습니다.");
|
|
console.log(JSON.stringify(err));
|
|
},
|
|
})
|
|
}
|
|
function loginWithNaver() {
|
|
$("#naverIdLogin_loginButton > img").trigger("click");
|
|
}
|
|
|
|
function loginWithGoogle() {
|
|
gauth = gapi.auth2.getAuthInstance();
|
|
gauth.signIn().then(function () {
|
|
location.href = "https://www.ynicte.com/Account/Join?jointype=1";
|
|
});
|
|
}
|
|
|
|
function snsInit() {
|
|
naverLogin.init();
|
|
Kakao.init("@kakaoClientId");
|
|
}
|
|
</script> |