Commit 86f3a14f authored by 何硕's avatar 何硕

test

parent adbc782c
...@@ -6,14 +6,14 @@ var io = require('socket.io')(http); ...@@ -6,14 +6,14 @@ var io = require('socket.io')(http);
let fs = require("fs"); let fs = require("fs");
app.all('*', function(req, res, next) { // app.all('*', function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*"); // res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Content-Type,Content-Length, Authorization, Accept,X-Requested-With"); // res.header("Access-Control-Allow-Headers", "Content-Type,Content-Length, Authorization, Accept,X-Requested-With");
res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS"); // res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
res.header("X-Powered-By",' 3.2.1'); // res.header("X-Powered-By",' 3.2.1');
res.header("Content-Type", "application/json;charset=utf-8"); // res.header("Content-Type", "application/json;charset=utf-8");
next(); // next();
}); // });
// var BaseUrl = "http://localhost/api/"; // var BaseUrl = "http://localhost/api/";
var BaseUrl = "https://zhibo.xueyoubangedu.com/api/"; var BaseUrl = "https://zhibo.xueyoubangedu.com/api/";
...@@ -30,7 +30,7 @@ app.get('/', function(req, res){ ...@@ -30,7 +30,7 @@ app.get('/', function(req, res){
}); });
io.on('connection', function(socket){ io.on('connection', function(socket){
console.log("connection");
//监听用户登录 //监听用户登录
socket.on('login', function(obj){ socket.on('login', function(obj){
var userid = obj.userid; var userid = obj.userid;
......
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