...
|
...
|
@@ -73,14 +73,29 @@ module.exports = { |
|
|
}
|
|
|
},
|
|
|
login: function (req, callback, common) {
|
|
|
|
|
|
console.log("enter login method ........................................");
|
|
|
|
|
|
var userInfo = {},result = { code: 400, message: "登录失败" },isSuccess=false;
|
|
|
|
|
|
|
|
|
var user = req.body.user||req.query.user;
|
|
|
var password = req.body.password||req.query.password;
|
|
|
var errcallback = function (err) {
|
|
|
|
|
|
console.log("enter login method ........................................&&&&&&&&&&&&&&&&&&&&&&&" + err);
|
|
|
|
|
|
return callback(null, result);
|
|
|
}
|
|
|
|
|
|
console.log("enter login method ........................................************");
|
|
|
|
|
|
common.Ilogin(user, password).allRight().sessionAsync(user, password).done(function (IloginRes,allRes,sesRes) {
|
|
|
var userData = IloginRes.data, cookie = sesRes.caseless.dict["set-cookie"];
|
|
|
|
|
|
console.log("enter userData is ........................................" + userData);
|
|
|
|
|
|
|
|
|
userInfo = { auth: userData, uid: userData.pid, name: userData.truename, role: userData.roleName, right: {},shopList:[],brands:[]};
|
|
|
if(userData.data_authority&&userData.data_authority.brand&&userData.data_authority.brand.list){
|
|
|
userInfo.brands=userData.data_authority.brand.is_all?"0":Object.keys(userData.data_authority.brand.list);
|
...
|
...
|
|