56 lines
1.7 KiB
Plaintext
56 lines
1.7 KiB
Plaintext
@{
|
|
Layout = null;
|
|
var naverClientId = ViewBag.naverClientID;
|
|
var kakaoClientId = ViewBag.kakaoClientID;
|
|
var googleClientId = ViewBag.googleClientID;
|
|
}
|
|
<head>
|
|
@Html.Partial("./Partial/JS")
|
|
<script type="text/javascript" src="/js/kakao.js"></script>
|
|
</head>
|
|
<script>
|
|
var snsid;
|
|
window.addEventListener('load', function () {
|
|
$.when(
|
|
Kakao.init("@kakaoClientId")
|
|
).done(function () {
|
|
Kakao.API.request({
|
|
url: '/v2/user/me',
|
|
success: function (res) {
|
|
snsid = res.id;
|
|
//0:일반회원가입,1:google,2:naver,3:kakao
|
|
capp("/focommon/CheckExistSnsId", { snsid: snsid, jointype: 3 }, "snslogin");
|
|
},
|
|
fail: function (error) {
|
|
console.log(error);
|
|
}
|
|
});
|
|
});
|
|
});
|
|
function snslogin() {
|
|
if (capResult.code > 0) {
|
|
capp("/focommon/SnsLogin", { uid: snsid, isSns: true }, "goHome()");
|
|
}
|
|
else {
|
|
if (confirm("카카오와 연동된 회원정보가 존재하지 않습니다.\r\n일반 로그인 후 SNS ID와 연동 기능을 이용하세요.")) {
|
|
goIndex();
|
|
}
|
|
else {
|
|
goIndex();
|
|
}
|
|
}
|
|
}
|
|
function goJoin() {
|
|
location.href = "/Account/Join?jointype=3";
|
|
}
|
|
function goHome() {
|
|
if (capResult.code > 0) {
|
|
location.href = "https://cte.nptc.kr";
|
|
}
|
|
}
|
|
function goIndex() {
|
|
location.href = "/Account/Index";
|
|
|
|
}
|
|
|
|
</script> |