get 方式提交数据
var url=require('url');
var optfile=require('./d24_optfile.js');
function getRecall(rq, rs){
rs.writeHead(200, {
'Content-Type':'text/html; charset=utf-8'});
function recall(data){
rs.write(data);
rs.end('');
}
return recall;
}
module.exports={
login:function(req, res){
var rdata=url.parse(req.url, true).query;
console.log(rdata);
if (rdata['email']!=undefined) {
console.log(rdata['email']);
console.log(rdata['pwd']);
}
var recall=getRecall(req, res);
optfile.readfileAsync('./views/d24_login_get.html', recall);
},
sign:function(req, res){
var recall=getRecall(req, res);
optfile.readfileAsync('./views/sign.html',recall);
},
writeFile: function(req, res){
var recall=getRecall(req, res);
optfile.writefileAsync('./views/one.txt','我写入的文件',recall)
},
showimg: function(req, res){
res.writeHead(200, {
'Content-Type':'image/jpeg'});
optfile