2020-10-12 14:39:23 +09:00
|
|
|
@model NP.Model.VMUser
|
2021-07-14 08:35:08 +09:00
|
|
|
@{
|
2020-11-27 09:31:40 +09:00
|
|
|
var naverClientId = ViewBag.naverClientID;
|
|
|
|
|
var kakaoClientId = ViewBag.kakaoClientID;
|
|
|
|
|
var googleClientId = ViewBag.googleClientID;
|
2020-11-25 16:04:00 +09:00
|
|
|
}
|
2020-11-19 16:34:36 +09:00
|
|
|
<head>
|
|
|
|
|
<script type="text/javascript" src="/js/naveridlogin_js_sdk_2.0.0.js"></script>
|
|
|
|
|
<script type="text/javascript" src="/js/kakao.js"></script>
|
2020-11-27 09:31:40 +09:00
|
|
|
<script src="https://apis.google.com/js/platform.js?onload=googleInit" async defer></script>
|
2020-11-19 16:34:36 +09:00
|
|
|
</head>
|
|
|
|
|
<form id="mform" action="" method="post">
|
|
|
|
|
<div class="lgnWrap">
|
|
|
|
|
<ul class="lgnForm">
|
|
|
|
|
<li><input type="text" name="uid" id="uid" placeholder="아이디" value="@ViewBag.SavedId" /></li>
|
|
|
|
|
<li><input type="password" name="upw" id="upw" placeholder="비밀번호" /></li>
|
|
|
|
|
</ul>
|
|
|
|
|
<div class="lgnChk">
|
|
|
|
|
<input type="checkbox" name="issaveid" id="issaveid" @(ViewBag.SavedId == "" ? "" : "checked")>
|
|
|
|
|
<label for="issaveid">아이디저장</label>
|
|
|
|
|
</div>
|
2021-11-10 08:53:00 +09:00
|
|
|
<p style="margin-bottom: 30px; border: 1px solid red; padding: 5px;">※ 2021년 7월 1일 이전에 회원가입을 하신 분 들은 본인인증을 위하여 회원가입을 다시 진행 해주시길 부탁드립니다.</p>
|
2020-11-19 16:34:36 +09:00
|
|
|
<a href="#" class="lgnBtn" onclick="login();">로그인</a>
|
2020-10-26 10:22:56 +09:00
|
|
|
|
2020-11-19 16:34:36 +09:00
|
|
|
<ul class="lgnFind">
|
|
|
|
|
<li><a href="/Account/FindMe">아이디/비밀번호찾기</a></li>
|
2021-06-30 15:31:47 +09:00
|
|
|
<li><a href="/Account/JoinIdVeri">회원가입</a></li>
|
2020-11-19 16:34:36 +09:00
|
|
|
</ul>
|
2020-10-26 10:22:56 +09:00
|
|
|
|
2020-11-19 16:34:36 +09:00
|
|
|
<br />
|
2021-07-14 08:35:08 +09:00
|
|
|
|
2021-07-13 18:33:26 +09:00
|
|
|
<div id="naverIdLogin" style="display:none"></div>
|
2021-08-23 15:10:15 +09:00
|
|
|
<ul class="lgnSns">
|
2020-11-19 16:34:36 +09:00
|
|
|
<li>
|
|
|
|
|
<a href="javascript:loginWithNaver()">네이버 아이디로 로그인</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
|
|
|
|
<a href="javascript:loginWithKakao()">카카오 아이디로 로그인</a>
|
|
|
|
|
</li>
|
2020-11-27 09:31:40 +09:00
|
|
|
<li>
|
|
|
|
|
<a href="javascript:loginWithGoogle()">구글 아이디로 로그인</a>
|
|
|
|
|
</li>
|
2021-07-13 18:33:26 +09:00
|
|
|
</ul>
|
2020-11-19 16:34:36 +09:00
|
|
|
</div>
|
|
|
|
|
</form>
|
2020-10-12 14:39:23 +09:00
|
|
|
|
|
|
|
|
<script>
|
2021-07-14 08:35:08 +09:00
|
|
|
|
2020-10-12 14:39:23 +09:00
|
|
|
$(document).ready(function () {
|
|
|
|
|
if (opener != null && opener._ismain == 1) {
|
|
|
|
|
opener.location.href = "/Account/Index";
|
|
|
|
|
self.close();
|
|
|
|
|
}
|
|
|
|
|
//else if (ViewBag.gossl == 1 && location.href.substr(0, 5) == 'http:') {
|
|
|
|
|
// location.href = 'https'+location.href.substr(4);
|
|
|
|
|
//}
|
|
|
|
|
else {
|
|
|
|
|
if (!ismobile()) {
|
|
|
|
|
if (val("uid").length > 0) { focus("upw"); } else { focus("uid"); }
|
|
|
|
|
}
|
|
|
|
|
$("#uid").on("keydown", function (e) {
|
|
|
|
|
if (e.keyCode == 13) {
|
|
|
|
|
if (val("uid") != "") {
|
|
|
|
|
focus("upw");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
focus("uid");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$("#upw").on("keydown", function (e) {
|
|
|
|
|
if (e.keyCode == 13) {
|
|
|
|
|
if (val("uid") != "" && val("upw") != "") {
|
|
|
|
|
login();
|
|
|
|
|
}
|
|
|
|
|
else if (val("uid") == "") {
|
|
|
|
|
focus("uid");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
focus("upw");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2020-11-19 16:34:36 +09:00
|
|
|
snsInit();
|
2020-10-12 14:39:23 +09:00
|
|
|
});
|
2021-07-14 08:35:08 +09:00
|
|
|
|
2020-10-12 14:39:23 +09:00
|
|
|
function login() {
|
|
|
|
|
if (val("uid") != "" && val("upw") != "") {
|
|
|
|
|
capp("/focommon/login", { uid: val("uid"), upw: val("upw"), issaveid: $("#issaveid").prop("checked") }, "cblogin");
|
|
|
|
|
}
|
|
|
|
|
else if (val("uid") == "") {
|
|
|
|
|
focus("uid");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
focus("upw");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function cblogin() {
|
|
|
|
|
if (capResult.code == 1000) {
|
|
|
|
|
if (capResult.obj == -1) {
|
2020-12-28 15:18:03 +09:00
|
|
|
msg("고객사 사용자는 고객사사이트를 이용해주세요.", null, null, null, "location.href='https://" + capResult.msg + ".cte.or.kr/Account/Index'");
|
2021-12-14 15:37:46 +09:00
|
|
|
}
|
|
|
|
|
else if (capResult.msg == "-2") { // 비밀번호 변경 90일 경과
|
|
|
|
|
$("#mform").attr("action", "/Account/Pwchange");
|
|
|
|
|
if ('@(Model.ru??"")' != "") {
|
|
|
|
|
$("#mform").attr("action", "@Model.ru".replace(/-/gi, '&'));
|
|
|
|
|
}
|
|
|
|
|
submit();
|
|
|
|
|
}
|
|
|
|
|
else if (capResult.msg == "-3") { // 휴면해제안내
|
|
|
|
|
$("#mform").attr("action", "/Account/DormantCancel");
|
|
|
|
|
if ('@(Model.ru??"")' != "") {
|
|
|
|
|
$("#mform").attr("action", "@Model.ru".replace(/-/gi, '&'));
|
|
|
|
|
}
|
|
|
|
|
submit();
|
|
|
|
|
}
|
|
|
|
|
else {
|
2020-10-12 14:39:23 +09:00
|
|
|
$("#mform").attr("action", "/");
|
|
|
|
|
if ('@(Model.ru??"")' != "") {
|
|
|
|
|
$("#mform").attr("action", "@Model.ru".replace(/-/gi, '&'));
|
|
|
|
|
}
|
|
|
|
|
submit();
|
|
|
|
|
}
|
|
|
|
|
} else { msg("입력하신 아이디/비밀번호와 일치하는 계정이 없습니다. 다시 확인해주세요."); }
|
|
|
|
|
}
|
2020-11-27 10:29:23 +09:00
|
|
|
|
|
|
|
|
var gauth;
|
|
|
|
|
function googleInit() {
|
2020-11-27 12:54:47 +09:00
|
|
|
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');})});
|
2020-11-27 10:29:23 +09:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 09:37:52 +09:00
|
|
|
var naverLogin = new naver.LoginWithNaverId({ clientId: "@naverClientId", callbackUrl: "https://www.cte.or.kr/Account/NaverCallback",isPopup: true,loginButton: { color: "green", type: 3, height: 60 }});
|
2020-11-19 16:34:36 +09:00
|
|
|
|
2020-11-20 15:10:32 +09:00
|
|
|
function loginWithKakao() {
|
2020-11-27 09:31:40 +09:00
|
|
|
Kakao.Auth.login({
|
|
|
|
|
success: function (authObj) {
|
2021-07-14 08:35:08 +09:00
|
|
|
Kakao.API.request({
|
|
|
|
|
url: '/v2/user/me',
|
|
|
|
|
success: function (res) {
|
2020-12-21 14:21:11 +09:00
|
|
|
location.href = "/Account/KakaoCallback";
|
2021-07-14 08:35:08 +09:00
|
|
|
},
|
|
|
|
|
fail: function (error) {
|
|
|
|
|
alert(
|
|
|
|
|
'login success, but failed to request user information: ' +
|
|
|
|
|
JSON.stringify(error)
|
|
|
|
|
)
|
|
|
|
|
},
|
2020-12-21 09:29:24 +09:00
|
|
|
})
|
2020-11-27 09:31:40 +09:00
|
|
|
},
|
|
|
|
|
fail: function (err) {
|
2020-12-28 14:49:31 +09:00
|
|
|
alert("카카오 아이디로 로그인에 실패했습니다.\r\n관리자에게 문의하세요.");
|
2020-11-27 09:31:40 +09:00
|
|
|
console.log(JSON.stringify(err))
|
|
|
|
|
},
|
2020-11-20 15:10:32 +09:00
|
|
|
})
|
2020-11-19 16:34:36 +09:00
|
|
|
}
|
|
|
|
|
|
2020-11-27 09:31:40 +09:00
|
|
|
function loginWithGoogle() {
|
|
|
|
|
gauth = gapi.auth2.getAuthInstance();
|
|
|
|
|
gauth.signIn().then(function () {
|
2020-12-16 13:39:57 +09:00
|
|
|
location.href = "/Account/GoogleCallback"
|
2020-11-27 09:31:40 +09:00
|
|
|
}, function () {
|
2020-12-28 14:49:31 +09:00
|
|
|
alert("구글 아이디로 로그인에 실패했습니다.\r\n관리자에게 문의하세요.");
|
2020-11-27 09:31:40 +09:00
|
|
|
return;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-19 16:34:36 +09:00
|
|
|
function loginWithNaver() {
|
|
|
|
|
$("#naverIdLogin_loginButton > img").trigger("click");
|
|
|
|
|
}
|
2021-07-14 08:35:08 +09:00
|
|
|
|
2020-11-19 16:34:36 +09:00
|
|
|
function snsInit() {
|
|
|
|
|
naverLogin.init();
|
2020-11-27 09:31:40 +09:00
|
|
|
Kakao.init("@kakaoClientId");
|
2020-11-19 16:34:36 +09:00
|
|
|
}
|
2020-10-12 14:39:23 +09:00
|
|
|
</script>
|