Authored by weiqingting

提交

@@ -81,8 +81,10 @@ module.exports = { @@ -81,8 +81,10 @@ module.exports = {
81 } 81 }
82 common.Ilogin(user, password).allRight().sessionAsync(user, password).done(function (IloginRes,allRes,sesRes) { 82 common.Ilogin(user, password).allRight().sessionAsync(user, password).done(function (IloginRes,allRes,sesRes) {
83 var userData = IloginRes.data, cookie = sesRes.caseless.dict["set-cookie"]; 83 var userData = IloginRes.data, cookie = sesRes.caseless.dict["set-cookie"];
84 -  
85 - userInfo = { auth: userData, uid: userData.pid, name: userData.truename, right: {},shopList:[]}; 84 + userInfo = { auth: userData, uid: userData.pid, name: userData.truename, right: {},shopList:[],brands:[]};
  85 + if(userData.data_authority&&userData.data_authority.brand&&userData.data_authority.brand.list){
  86 + userInfo.brands=Object.keys(userData.data_authority.brand.list);
  87 + }
86 allRes.data.forEach(function (data) { 88 allRes.data.forEach(function (data) {
87 if (data.platform_id == Iaccount.WEBSITE) { 89 if (data.platform_id == Iaccount.WEBSITE) {
88 userInfo.right[data.path] = true; 90 userInfo.right[data.path] = true;
@@ -120,7 +122,7 @@ module.exports = { @@ -120,7 +122,7 @@ module.exports = {
120 'x-user-name': user.auth.account, 122 'x-user-name': user.auth.account,
121 'x-site-type': Iaccount.WEBSITE, 123 'x-site-type': Iaccount.WEBSITE,
122 'x-client-ip': req.ip, 124 'x-client-ip': req.ip,
123 - 'x-user-brands': "1,2,3,4,5,6,7,8,9" 125 + 'x-user-brands': user.brands.join(',')
124 }; 126 };
125 if (path && user.right[path]) { 127 if (path && user.right[path]) {
126 common.isUsedMenuAuth(user.auth.pid,user.auth.role_id,path).done(function(isURes){ 128 common.isUsedMenuAuth(user.auth.pid,user.auth.role_id,path).done(function(isURes){