This commit is contained in:
parent
08240f136f
commit
7a96fc1df2
|
|
@ -11,68 +11,12 @@
|
||||||
<form id="mform" method="post">
|
<form id="mform" method="post">
|
||||||
<div class="jnSns">
|
<div class="jnSns">
|
||||||
<a href="#" onclick="javascript: $('#mform').attr('action', '/Account/JoinIdVeri').submit();">영남건설 기술 교육원 홈페이지 회원가입</a>
|
<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>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(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://cte.nptc.kr/Account/NaverCallbackJoin",isPopup: true, loginButton: { color: "green", type: 3, height: 60 }});
|
|
||||||
|
|
||||||
function loginWithKakao() {
|
|
||||||
Kakao.Auth.login({
|
|
||||||
success: function (authObj) {
|
|
||||||
Kakao.API.request({
|
|
||||||
url: '/v2/user/me',
|
|
||||||
success: function (res) {
|
|
||||||
location.href = "/Account/Join?jointype=3";
|
|
||||||
},
|
|
||||||
fail: function (error) {
|
|
||||||
alert(
|
|
||||||
'login success, but failed to request user information: ' +
|
|
||||||
JSON.stringify(error)
|
|
||||||
)
|
|
||||||
},
|
|
||||||
})
|
|
||||||
},
|
|
||||||
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 = "/Account/Join?jointype=1";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function snsInit() {
|
|
||||||
naverLogin.init();
|
|
||||||
Kakao.init("@kakaoClientId");
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
Loading…
Reference in New Issue