|
|
@@ -24,30 +24,39 @@ define([ 'app/app' ], function(app) {
|
|
|
'release/product/release/excel/pcb',
|
|
|
'release/product/batchRelease/pcb',
|
|
|
'release/product/batchRelease',
|
|
|
- 'release/product/batchRelease/person'
|
|
|
+ 'release/product/batchRelease/person',
|
|
|
+ // b2b客户资料列表移入请求
|
|
|
+ '/vendor/userInfo'
|
|
|
]
|
|
|
+ var isInArr = function (url) {
|
|
|
+ for (var i = 0; i < RegluArr.length; i++) {
|
|
|
+ if (new RegExp(RegluArr[i]).test(url)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
return {
|
|
|
request: function(cfg){
|
|
|
- // console.log(cfg.url)
|
|
|
- if(cfg.url && RegluArr.indexOf(cfg.url) < 0) {
|
|
|
+ if(cfg.url && !isInArr(cfg.url)) {
|
|
|
startLoading();
|
|
|
}
|
|
|
return cfg;
|
|
|
},
|
|
|
requestError: function(rejection) {
|
|
|
- if(rejection.config.url && RegluArr.indexOf(rejection.config.url) < 0) {
|
|
|
+ if(rejection.config.url && !isInArr(rejection.config.url)) {
|
|
|
endLoading();
|
|
|
}
|
|
|
return $q.reject(rejection);
|
|
|
},
|
|
|
response: function(res) {
|
|
|
- if(res.config.url && RegluArr.indexOf(res.config.url) < 0) {
|
|
|
+ if(res.config.url && !isInArr(res.config.url)) {
|
|
|
endLoading();
|
|
|
}
|
|
|
return res;
|
|
|
},
|
|
|
responseError: function(rejection) {
|
|
|
- if(rejection.config.url && RegluArr.indexOf(rejection.config.url) < 0) {
|
|
|
+ if(rejection.config.url && !isInArr(rejection.config.url)) {
|
|
|
endLoading();
|
|
|
}
|
|
|
if(rejection.status == 401) {
|