Commit c8e0704b authored by agping's avatar agping

修改

parent 68f0e92d
$(function(){
$(function() {
var _heightTemp = $(window).height();
if(_heightTemp<680){
if(_heightTemp < 680) {
$('header,footer').addClass('small-screen');
}
$('.main-area').height(_heightTemp);
$(document.body).show();//页面显示出来
$(document.body).show(); //页面显示出来
//以上针对不同屏幕高度动态处理一些样式
var _loginBtn = $('#btn_login'),
_loginTempBtn = $('#btn_login_temp');
$('.input-area>input').focus(function(){
$('.input-area>input').focus(function() {
$(this).parent().addClass('input-area-active');
}).blur(function(){
}).blur(function() {
$(this).parent().removeClass('input-area-active');
});
//回车按键
$(document).keypress(function(event){
$(document).keypress(function(event) {
var keynum = (event.keyCode ? event.keyCode : event.which);
if(keynum == '13'){
if(keynum == '13') {
_loginBtn.click();
}
});
_loginBtn.click(function(e){
_loginBtn.click(function(e) {
e.preventDefault();
e.stopPropagation();
var _userName = $.trim($('#username').val()),
_passWord = $.trim($('#passwd').val());
if(_userName == ''){
if(_userName == '') {
alert('请输入用户名');
return false;
};
if(_passWord == ''){
if(_passWord == '') {
alert('请输入登录密码');
return false;
};
//登陆的时候 获取电脑端 浏览器的型号和版本信息
var NV = {};
var UA = navigator.userAgent.toLowerCase();
try {
......@@ -68,10 +69,10 @@ $(function(){
NV.name;
} catch(e) {};
//判断 谷歌 360 application/vnd.chromium.remoting-viewer 可能为360特有
if(NV.name=='chrome'){
if(NV.name == 'chrome') {
var is360 = _mime("type", "application/vnd.chromium.remoting-viewer");
if(isChrome() && is360) {
NV.shell='360浏览器'
NV.shell = '360浏览器'
}
//检测是否是谷歌内核(可排除360及谷歌以外的浏览器)
function isChrome() {
......@@ -90,19 +91,20 @@ $(function(){
}
}
// alert('浏览器UA=' + UA +
// '\n\n浏览器名称=' + NV.name +
// '\n\n浏览器版本=' + NV.version +
// //'\n\n浏览器版本='+parseInt(NV.version)+
// '\n\n浏览器外壳=' + NV.shell);
var browser_version=NV.shell+'/'+NV.version;
// alert('浏览器UA=' + UA +
// '\n\n浏览器名称=' + NV.name +
// '\n\n浏览器版本=' + NV.version +
// //'\n\n浏览器版本='+parseInt(NV.version)+
// '\n\n浏览器外壳=' + NV.shell);
var browser_version = NV.shell + '/' + NV.version;
console.log(browser_version);
$.ajax({
type: 'POST',
url: '/admin.php/index/loginVerify',
data: {
'username': _userName,
'password': _passWord,
'model':browser_version
'model': browser_version
},
timeout: 30000,
dataType: 'json',
......@@ -112,23 +114,23 @@ $(function(){
},
success: function(data) {
if(typeof data === 'object') {
if (data.code == 200) {
localStorage.setItem('pcUserInfo',encodeURIComponent(JSON.stringify(data.data)));//存储PC后台登录用户所有信息
if(data.code == 200) {
localStorage.setItem('pcUserInfo', encodeURIComponent(JSON.stringify(data.data))); //存储PC后台登录用户所有信息
location.href = '/admin.php/index/getHouseList';
}else {
} else {
alert(data['msg']);
};
}else{
} else {
alert('数据错误');
};
},
error: function() {
alert('error');
},
complete: function(xhr, textStatus){
complete: function(xhr, textStatus) {
_loginTempBtn.hide();
_loginBtn.show();
if(textStatus === 'timeout'){
if(textStatus === 'timeout') {
alert('请求超时');
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment