|
|
@@ -63,7 +63,7 @@ define([ 'angular', 'common/utils', 'big'], function(angular, utils, Big) {
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
- }).factory('BaseService', ['$rootScope', function($rootScope) {
|
|
|
+ }).factory('BaseService', ['$rootScope', '$http', '$q', function($rootScope, $http, $q) {
|
|
|
return {
|
|
|
getRootPath: function() {
|
|
|
var pathName = window.location.pathname.substring(1);
|
|
|
@@ -138,7 +138,22 @@ define([ 'angular', 'common/utils', 'big'], function(angular, utils, Big) {
|
|
|
}
|
|
|
},
|
|
|
getB2bUrl: function () {
|
|
|
- return 'http://10.1.51.88:8090/platform-b2b/';
|
|
|
+ if (!$rootScope.b2bUrl) {
|
|
|
+ // var defer = $q.defer();
|
|
|
+ // $http({
|
|
|
+ // method: 'get',
|
|
|
+ // url: 'b2b/sale/accessUrl'
|
|
|
+ // }).success(function (data) {
|
|
|
+ // defer.resolve(data);
|
|
|
+ // }).error(function (error) {
|
|
|
+ // defer.reject(error);
|
|
|
+ // });
|
|
|
+ // defer.promise.then(function (resolve) {
|
|
|
+ // $rootScope.b2bUrl = resolve.url;
|
|
|
+ // });
|
|
|
+ $rootScope.b2bUrl = this.getRootPath().indexOf('usoftmall.com') > -1 ? 'http://uas.ubtob.com' : 'http://192.168.253.12:9000/b2b-test';
|
|
|
+ }
|
|
|
+ return $rootScope.b2bUrl;
|
|
|
}
|
|
|
};
|
|
|
}]).factory('AuthenticationService', ['$http', 'SessionService', 'BaseService', 'SerializerUtil', function($http, SessionService, BaseService, SerializerUtil) {
|