Commit c8e0704b authored by agping's avatar agping

修改

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