// JavaScript Document
function OpenLoad() {
$('#Dialog-Load').dialog({
width: 90,
height: 37,
border: false,
noheader: true,
modal: true,
content: '
\n' +
'
\n' +
'
请稍等...\n' +
'
',
})
}
function CloseLoad() {
$('#Dialog-Load').dialog('close');
}
function Login() {
var n = $("#name").val();
var p = $("#pass").val();
if (n.length < 3) {
$.messager.alert('警告', '非法的用户名称...', 'error');
return;
}
if (p.length < 3) {
$.messager.alert('警告', '非法的用户密码...', 'error');
return;
}
var json = {
"username": n,
"password": p,
}
var aj = $.ajax({
beforeSend: function () {
OpenLoad();
},
success: function () {
CloseLoad();
if (json.username != "admin" && json.password != "admin") {
$.messager.alert('警告', 'error');
} else {
window.location.href = "/web/main/";
}
},
error: function () {
CloseLoad();
$.messager.alert('警告', '与服务器通讯失败...', 'error');
}
})
}