===========post============
var url = '/Login/CheckLogin';
var postData = Qs.stringify({ username: this.username, userpass: this.userpass });
$.blockUI({ message: "数据提交中...", css: { backgroundColor: '#d2d2d2', color: '#fff' } });
axios.post(url, postData, {
headers: {
'X-Requested-With': 'XMLHttpRequest'
}
}).then(function (response) {
//alert(JSON.stringify(response.data));
//response.data.Data.mxList
if (response.data.Tag == 1) {
$("#app").show();
$.unblockUI();
vm.obj = response.data;
alert(JSON.stringify(vm.obj));
}
})
.catch(function (error) {
alert(JSON.stringify(error));
});
=============get==============
var url = '/DapingAreas/DefaultPage/GetDefaultPageJson';
var postData ={};
$.blockUI({ message: "数据加载中...", css: { backgroundColor: '#d2d2d2', color: '#fff' } });
axios.get(url, {
headers: {
'X-Requested-With': 'XMLHttpRequest'
},
params: postData
}).then(function (response) {
//alert(JSON.stringify(response.data));
//response.data.Data.mxList
if (response.data.Tag == 1) {
$("#app").show();
$.unblockUI();
vm.obj = response.data.Data;
vm.nrList = vm.obj.nrList;
vm.page1_mxList = vm.obj.mxList;
vm.page1_汇总性别分布 = vm.obj.汇总性别分布;
vm.page1_汇总年龄分布 = vm.obj.汇总年龄分布;
vm.今年 = vm.obj.今年;
vm.p5starttime = ys.formatDate(vm.obj.当天, "yyyy-MM-dd");
//alert(JSON.stringify(vm.page1_mxList));
page1Echart();
} else if (response.data.Tag == -100) {
ys.msgError(response.data.Message);
setTimeout(function () {
window.top.location.href = "login.html";
}, 3000);
}
})
.catch(function (error) {
alert(JSON.stringify(error));
});