Authored by 周奇琪

http头加shopId。灰度,如果是ajax,需要设置cookie

... ... @@ -18,7 +18,7 @@ var guestAccessList = {
var NO_AUTH = '没有权限!';
var WEBSITE = 1;
var WEBSITE = 2;
var CSS_FILE = '/dist/login.css';
... ... @@ -144,6 +144,7 @@ function appendAdminInfo(req,auth) {
'x-user-id':auth.pid,
'x-user-name':auth.account,
'x-site-type':WEBSITE,
'x-client-ip':ip
'x-client-ip':ip,
'x-shop-id':auth.shopId
};
}
\ No newline at end of file
... ...
... ... @@ -58,7 +58,7 @@ module.exports = function(proxyRoute) {
logger.log('info','grayroute: request options: %j',options,{});
//发起代理请求
if(req.headers['accept'].indexOf('text/html')>-1) {
if(req.headers['accept'].indexOf('text/html')>-1||req.xhr) {
request(options,function(err,res,body) {
if(err) {
logger.log('error','grayroute: request error:',err);
... ...