You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWebMobile/Scripts/validate.js

51 lines
2.6 KiB
JavaScript

3 years ago
$(function () {
$("#txtPassword").keyup(function (event) {
if (event.which == 13) {
fnLogin();
}
});
});
function fnLogin() {
var _mydate = new Date();
var _year = _mydate.getFullYear();
var _month = _mydate.getMonth() + 1;
var _day = _mydate.getDate();
var _hours = _mydate.getHours();
var _userName = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtUserName").val());
var _password = jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), $("#txtPassword").val());
$.ajax({
type: "post",
dataType: "json",
url: "../../Handler/SetCheckSign.ashx?action=0&u=" + _userName + "&w=" + _password + "&y=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), _year.toString()) + "&m=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), _month.toString()) + "&d=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), _day.toString()) + "&h=" + jsencrypt(decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"), _hours.toString()),
cache: false,
success: function (msg) {
$.ajax({
type: "post",
dataType: "json",
data: { userName: _userName, password: _password },
url: "/Login/LoginInfo/",
cache: false,
success: function (msg2) {
//alert(msg);
/*$.each(msg2, function (i, item2) {
alert(item2.CODENAME);
});*/
fnCookieSave();
//window.location.href = "Index.aspx?u=" + encrypt(u, decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs")) + "&w=" + encrypt(w, decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"));
//window.location.href = "/Home/GetParam?name=xxx&length=9"
_userName = $("#txtUserName").val();
_password = $("#txtPassword").val();
window.location.href = "/Home/Index?u=" + encrypt(_userName, decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs")) + "&w=" + encrypt(_password, decrypt("8cdd29a091e29cc101042f65", "^id548f@^fueam##54325jfs"));
},
error: function () {
//window.open("login.aspx", "_self");
//window.location.href = "login.aspx";
qikoo.dialog.alert("密码错误,请重新输入!");
}
});
}
});
}