Authored by mali

账号安全登录

@@ -73,14 +73,29 @@ module.exports = { @@ -73,14 +73,29 @@ module.exports = {
73 } 73 }
74 }, 74 },
75 login: function (req, callback, common) { 75 login: function (req, callback, common) {
  76 +
  77 + console.log("enter login method ........................................");
  78 +
76 var userInfo = {},result = { code: 400, message: "登录失败" },isSuccess=false; 79 var userInfo = {},result = { code: 400, message: "登录失败" },isSuccess=false;
  80 +
  81 +
77 var user = req.body.user||req.query.user; 82 var user = req.body.user||req.query.user;
78 var password = req.body.password||req.query.password; 83 var password = req.body.password||req.query.password;
79 var errcallback = function (err) { 84 var errcallback = function (err) {
  85 +
  86 + console.log("enter login method ........................................&&&&&&&&&&&&&&&&&&&&&&&" + err);
  87 +
80 return callback(null, result); 88 return callback(null, result);
81 } 89 }
  90 +
  91 + console.log("enter login method ........................................************");
  92 +
82 common.Ilogin(user, password).allRight().sessionAsync(user, password).done(function (IloginRes,allRes,sesRes) { 93 common.Ilogin(user, password).allRight().sessionAsync(user, password).done(function (IloginRes,allRes,sesRes) {
83 var userData = IloginRes.data, cookie = sesRes.caseless.dict["set-cookie"]; 94 var userData = IloginRes.data, cookie = sesRes.caseless.dict["set-cookie"];
  95 +
  96 + console.log("enter userData is ........................................" + userData);
  97 +
  98 +
84 userInfo = { auth: userData, uid: userData.pid, name: userData.truename, role: userData.roleName, right: {},shopList:[],brands:[]}; 99 userInfo = { auth: userData, uid: userData.pid, name: userData.truename, role: userData.roleName, right: {},shopList:[],brands:[]};
85 if(userData.data_authority&&userData.data_authority.brand&&userData.data_authority.brand.list){ 100 if(userData.data_authority&&userData.data_authority.brand&&userData.data_authority.brand.list){
86 userInfo.brands=userData.data_authority.brand.is_all?"0":Object.keys(userData.data_authority.brand.list); 101 userInfo.brands=userData.data_authority.brand.is_all?"0":Object.keys(userData.data_authority.brand.list);
@@ -8,6 +8,7 @@ if(href) { @@ -8,6 +8,7 @@ if(href) {
8 alert("用户名或者密码错误,请确认!"); 8 alert("用户名或者密码错误,请确认!");
9 } 9 }
10 10
11 - window.location.href = "/login"; 11 + //window.location.href = "/login";
  12 + window.location.href = "/account/profile/changepassword";
12 } 13 }
13 } 14 }