TOGETHER
/metronic_v5.2/assets/vendors/base/vendors.bundle.js
/metronic_v5.2/assets/demo/default/base/scripts.bundle.js
/js/jquery.validate.min.js
/metronic_v5.2/assets/vendors/custom/fullcalendar/fullcalendar.bundle.js
/metronic_v5.2/assets/app/js/dashboard.js
/cultures/gameAppCode.js?
/cultures/langResx.js?
/cultures/langResx.zh-CN.js?
/cultures/langResx.th-TH.js?
/cultures/langResx.ms-MY.js?
/cultures/langResx.id-ID.js?
/cultures/langResx.vi-VN.js?
/js/gApp.js?
langCurrent = ‘en-US’;
input.error1 {
border: 1px solid red;
}
.errorMessage {
color: red;
}
.m-form .m-form__group > label.error {
color: red;
}
label.error {
color: red;
padding-left: 3px;
display: block;
}
.ErrorPrompt {
color: red;
}
.modal-dialog {
top: 20%;
}
$(document).ready(function () {
if (location.protocol == ‘http:’)
{
location.href = ‘https:’ + window.location.href.substring(window.location.protocol.length);
}
$(“#Language”).val(“en-US”);
$(document).ajaxStart($.blockUI).ajaxStop($.unblockUI);
//loadResources(“https://masterapi.api2u.cc”, “www.agent4u.vip”, true);
$(“#frmLogin”).validate({
rules: {
UserName: {
required: true,
maxlength: 50
},
Password: {
required: true,
maxlength: 50
}
},
messages: {
UserName: {
required: “Please Enter User Name”,
maxlength: “The length of User Name should be less than or equal to 50.”
},
Password: {
required:”Please Enter Password”,
maxlength:”The length of Password should be less than or equal to 50.”
}
}
});
var InitDeviceId = function () {
GetDeviceId();
};
InitDeviceId();
function SubmitLogin() {
var $form = $(‘#frmLogin’);
if ($form.valid()) {
$.blockUI();
var modelItem = {
Username: $(‘#UserName’).val(),
Password: $(‘#Password’).val(),
ClientType: “Web”
}
$.ajax({
url: ‘https://masterapi.api2u.cc/Token/CreateToken’,
type: “POST”,
datatype: “json”,
contentType: ‘application/json; charset=utf-8’,
timeout: 60000,
data: JSON.stringify(modelItem),
success: function (result) {
if (result.status != gameAppCode.Success && result.status != gameAppCode.Freezed && result.status != gameAppCode.MemberAccountFrozen) {
if (result.data != “” && result.data != null && result.data != undefined && result.data > 0) {
Showalert(getLValue(gameAppCode.LoginTip).format(result.data));
} else {
Showalert(getLValue(result.status));
}
}
else {
if (result.status == gameAppCode.Freezed || result.status == gameAppCode.MemberAccountFrozen) {
confirmDialog(getLValue(result.status), “User Login”, function () {
var modelUser = {
UserId: $(‘#UserName’).val(),
CodeT: result.data.token,
CodeS: result.data.codeS,
Language: $(“#Language”).val()
}
var UserInfo = JSON.stringify(modelUser);
$.ajax({
url: ‘/Account/Login2’,
type: “POST”,
datatype: “json”,
contentType: ‘application/json; charset=utf-8’,
timeout: 60000,
data: UserInfo,
success: function (result2) {
if (result.data.isShowTips) {
$.get(“/Template/ShareholderTips.html?v=1”, function (data) {
if (data.length > 0) {
PreventDialog(data, “”, function () {
pageJump(result, result2);
});
} else {
pageJump(result, result2);
}
});
} else {
pageJump(result, result2);
}
}
});
});
}
else {
var modelUser = {
UserId: $(‘#UserName’).val(),
CodeT: result.data.token,
CodeS: result.data.codeS,
Language: $(“#Language”).val()
}
var UserInfo = JSON.stringify(modelUser);
$.ajax({
url: ‘/Account/Login2’,
type: “POST”,
datatype: “json”,
contentType: ‘application/json; charset=utf-8’,
timeout: 60000,
data: UserInfo,
success: function (result2) {
if (result.data.isShowTips) {
$.get(“/Template/ShareholderTips.html?v=” + Math.random(), function (data) {
if (data.length > 0) {
PreventDialog(data, “”, function () {
pageJump(result, result2);
});
} else {
pageJump(result, result2);
}
});
} else {
pageJump(result, result2);
}
}
});
}
}
},
error: function (xhr, textStatus, errorThrown) {
// debugger;
// alert(getLValue(gameAppCode.SystemError));
//console.log(errorThrown);
Showalert(getLValue(gameAppCode.SystemError));
}
});
}
else {
$.unblockUI();
}
return false;
}
function pageJump(result, result2) {
if (result.data.needBindPhoneNo) {
location.href = “/Account/NeedBindPhoneNo”;
return;
}
else if(!result.data.isVerificationSuccess){
location.href = “/Account/AuthLogin”;
} else if (result.data.isVerificationSuccess) {
if (result.data.needChangePassword) {
location.href = “/Account/NeedChangePwd”;
} else
location.href = ‘/#/Home’;
}
else {
Showalert(getLValue(gameAppCode.LoginFail));
}
}
$(‘#frmLogin’).on(‘keyup’, function (e) {
if (e.keyCode == 13) {
// SubmitLogin();
}
});
$(‘#frmLogin’).on(‘click’, ‘#btnSubmit’, function (event) {
event.preventDefault();
$(“#btnSubmit”).attr(“disabled”, “disabled”);
setTimeout(function () {
$(“#btnSubmit”).removeAttr(“disabled”)
}, 1000);//1秒后才能点击
SubmitLogin();
});
$(“#Language”).change(function () {
var languageType = $(this).val();
location.href = “/Home/SetLanguage?culture=” + languageType + “&returnUrl=/Account/Login”;
})
}); //end document ready
function Showalert(msg) {
$(“#m_modal_1”).modal(null);
$(‘#modal-body’).html(msg);
}
$(function () {
$(‘#m_modal_1’).on(‘hide.bs.modal’, function () {
$(‘#modal-body’).html(“”);
// alert(“Clearn Data”);
})
})
