Authored by weiqingting

提交

@@ -3,7 +3,11 @@ module.exports=function(Filter){ @@ -3,7 +3,11 @@ module.exports=function(Filter){
3 if(gray.code==200){ 3 if(gray.code==200){
4 next(); 4 next();
5 }else{ 5 }else{
6 - res.redirect('/login'); 6 + if(req.xhr){
  7 + res.json(gray);
  8 + }else{
  9 + res.redirect('/login');
  10 + }
7 } 11 }
8 }); 12 });
9 }; 13 };
@@ -65,12 +65,12 @@ var apiCofig = { @@ -65,12 +65,12 @@ var apiCofig = {
65 views: path.resolve(__dirname,"apps", "0", "views/1") 65 views: path.resolve(__dirname,"apps", "0", "views/1")
66 }, 66 },
67 useToEntry:function(app){ 67 useToEntry:function(app){
68 - // if(process.env.NODE_ENV!="coding"){  
69 - // options.store=new Redis({  
70 - // port: 6379,  
71 - // host: 'localhost'  
72 - // });  
73 - // } 68 + if(process.env.NODE_ENV!="coding"&&process.env.NODE_ENV!=="test"){
  69 + options.store=new Redis({
  70 + port: 6379,
  71 + host: 'localhost'
  72 + });
  73 + }
74 app.use(session(options)); 74 app.use(session(options));
75 }, 75 },
76 useToOuter:function(app,controllers){ 76 useToOuter:function(app,controllers){
@@ -93,6 +93,12 @@ if(process.env.NODE_ENV!="coding"){ @@ -93,6 +93,12 @@ if(process.env.NODE_ENV!="coding"){
93 views: path.resolve(__dirname,"views", "0", "1") 93 views: path.resolve(__dirname,"views", "0", "1")
94 } 94 }
95 } 95 }
  96 +/*线下测试环境*/
  97 +if(process.env.NODE_ENV==="test211"){
  98 + apiCofig.EnvConst.domain="http://192.168.102.202:8088/platform";
  99 + apiCofig.EnvConst.bigdata="http://192.168.102.202:8091/bigdata";
  100 +}
  101 +/*腾讯云*/
96 if(process.env.NODE_ENV==="test"){ 102 if(process.env.NODE_ENV==="test"){
97 apiCofig.EnvConst.domain="http://10.66.100.6:8088/platform"; 103 apiCofig.EnvConst.domain="http://10.66.100.6:8088/platform";
98 apiCofig.EnvConst.bigdata="http://10.66.100.7:8091/bigdata"; 104 apiCofig.EnvConst.bigdata="http://10.66.100.7:8091/bigdata";
@@ -149,6 +149,9 @@ module.exports = { @@ -149,6 +149,9 @@ module.exports = {
149 if (path && user.right[path]) { 149 if (path && user.right[path]) {
150 common.isUsedMenuAuth(user.auth.pid,user.auth.role_id,path).done(function(isURes){ 150 common.isUsedMenuAuth(user.auth.pid,user.auth.role_id,path).done(function(isURes){
151 result = { code: 200, message: "具有权限" }; 151 result = { code: 200, message: "具有权限" };
  152 + if(isURes.data){
  153 + result={code:isURes.data.code,message:isURes.data.errmsg};
  154 + }
152 return callback(null, result); 155 return callback(null, result);
153 },function(error){ 156 },function(error){
154 return callback(error, result); 157 return callback(error, result);