Skip to content

Commit

Permalink
ajax
Browse files Browse the repository at this point in the history
返回成功移动到所有服务器操作结束后
  • Loading branch information
superchenney committed Aug 10, 2015
1 parent 97a5d23 commit 67c978a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,36 +172,39 @@ function saveInfo(req,housename,operate){

router.route('/kaichuang').post(function(req,res){
// kaiChuang();
res.send(200,"开窗"); //AJAX请求返回成功
saveInfo(req,'卧室','开窗');
console.log('\n' + '***** ' + req.session.user.name + '开窗 ******' + '\n');
res.send(200,"开窗ok"); //AJAX请求返回成功
});



router.route('/guanchuang').post(function(req,res){
// guanChuang();
res.send(200,'关窗'); //AJAX请求返回成功
saveInfo(req,'卧室','关窗')
console.log('\n' + '***** ' + req.session.user.name + '关窗 ******' + '\n')

saveInfo(req,'卧室','关窗');
console.log('\n' + '***** ' + req.session.user.name + '关窗 ******' + '\n');
res.send(200,"关窗ok"); //AJAX请求返回成功
});



router.route('/kaideng').post(function(req,res){
// kaiDeng();
res.send(200,'开灯'); //AJAX请求返回成功

saveInfo(req,'客厅','开灯');
console.log('\n' + '***** ' + req.session.user.name + '开灯 ******' + '\n');
res.send(200,'开灯ok'); //AJAX请求返回成功
});



router.route('/guandeng').post(function(req,res){
// guanDeng();
res.send(200,'关灯'); //AJAX请求返回成功

saveInfo(req,'客厅','关灯');
console.log('\n' + '***** ' + req.session.user.name + '关灯 ******' + '\n');
res.send(200,'关灯ok'); //AJAX请求返回成功
});


Expand Down

0 comments on commit 67c978a

Please sign in to comment.