...
|
...
|
@@ -84,7 +84,7 @@ module.exports = { |
|
|
var user = req.body.user;
|
|
|
var password = req.body.password;
|
|
|
var errcallback = function (err) {
|
|
|
return callback(null, result);
|
|
|
return callback(err, result);
|
|
|
}
|
|
|
common.Ilogin(user, password).allRight().sessionAsync(user, password).done(function (IloginRes,allRes,sesRes) {
|
|
|
var userData = IloginRes.data, cookie = sesRes.caseless.dict["set-cookie"];
|
...
|
...
|
@@ -109,12 +109,8 @@ module.exports = { |
|
|
id: data.shopsId
|
|
|
});
|
|
|
});
|
|
|
|
|
|
console.log("userInfo",userInfo);
|
|
|
req.session.user = userInfo;
|
|
|
|
|
|
if (cookie && cookie.length > 0) {
|
|
|
console.log("cookie",cookie[0]);
|
|
|
req.session.gray = cookie[0];
|
|
|
result = { code: 200, message: "登录成功" };
|
|
|
}
|
...
|
...
|
@@ -139,7 +135,6 @@ module.exports = { |
|
|
},
|
|
|
gray: function (req, callback,common) {
|
|
|
var result = { code: 201, message: "没有权限" };
|
|
|
console.log("session gray");
|
|
|
if (req.session && req.session.user) {
|
|
|
var user = req.session.user;
|
|
|
var path = req.route?req.route.path[0]:req.originalUrl.replace(/\?.+/, '');
|
...
|
...
|
|