Codigo gulp reorganizado, errores redirección solucionados
This commit is contained in:
parent
481a2219ce
commit
f9842000d3
|
@ -60,8 +60,12 @@ function vnAppInterceptor($q, $rootScope, $window, logger, $translate, $cookies)
|
|||
else
|
||||
error = `${rejection.status}: ${rejection.statusText}`;
|
||||
|
||||
if (rejection.status === 401)
|
||||
$window.location = '/auth';
|
||||
if (rejection.status === 401) {
|
||||
let location = $window.location;
|
||||
let continueUrl = location.pathname + location.search + location.hash;
|
||||
continueUrl = encodeURIComponent(continueUrl);
|
||||
$window.location = `/auth?continue=${continueUrl}`;
|
||||
}
|
||||
|
||||
logger.showError(error);
|
||||
return $q.reject(rejection);
|
||||
|
|
29
gulpfile.js
29
gulpfile.js
|
@ -20,18 +20,25 @@ var webpackConfig = require('./webpack.config.js');
|
|||
|
||||
// Main tasks
|
||||
|
||||
gulp.task('default', function() {
|
||||
return gulp.start('services', 'client');
|
||||
});
|
||||
|
||||
gulp.task('build', ['clean'], function() {
|
||||
return gulp.start('routes', 'locales', 'webpack');
|
||||
});
|
||||
|
||||
gulp.task('default', ['clean'], function() {
|
||||
return gulp.start('services', 'watch', 'routes', 'locales', 'webpack-dev-server');
|
||||
});
|
||||
|
||||
gulp.task('client', ['clean'], function() {
|
||||
return gulp.start('watch', 'routes', 'locales', 'webpack-dev-server');
|
||||
});
|
||||
|
||||
gulp.task('services', function() {
|
||||
require('./services/auth/server/server.js').start();
|
||||
require('./services/client/server/server.js').start();
|
||||
require('./services/salix/server/server.js').start();
|
||||
require('./services/mailer/server.js').start();
|
||||
});
|
||||
|
||||
gulp.task('clean', function() {
|
||||
return del(`${buildDir}/*`, {force: true});
|
||||
});
|
||||
|
@ -151,17 +158,3 @@ gulp.task('watch', function() {
|
|||
gulp.watch(routeFiles, ['routes']);
|
||||
gulp.watch(localeFiles, ['locales']);
|
||||
});
|
||||
|
||||
// Services
|
||||
|
||||
gulp.task('services', function() {
|
||||
var auth = require('./services/auth/server/server.js');
|
||||
var client = require('./services/client/server/server.js');
|
||||
var server = require('./services/salix/server/server.js');
|
||||
var mailer = require('./services/mailer/server.js');
|
||||
|
||||
auth.start();
|
||||
client.start();
|
||||
server.start();
|
||||
mailer.start();
|
||||
});
|
||||
|
|
|
@ -25,23 +25,19 @@ http {
|
|||
server_name localhost;
|
||||
autoindex off;
|
||||
|
||||
location ~ ^/static/(?:(.*))?$ {
|
||||
location ~ ^/static(?:/(.*))?$ {
|
||||
proxy_pass http://127.0.0.1:8081/$1$is_args$args;
|
||||
}
|
||||
|
||||
location ~ ^/auth/(?:(.*))?$ {
|
||||
location ~ ^/auth(?:/(.*))?$ {
|
||||
proxy_pass http://127.0.0.1:3000/$1$is_args$args;
|
||||
}
|
||||
|
||||
location ~ ^/client/(?:(.*))?$ {
|
||||
location ~ ^/client(?:/(.*))?$ {
|
||||
proxy_pass http://127.0.0.1:3002/$1$is_args$args;
|
||||
}
|
||||
|
||||
location ~ ^/mailer/(?:(.*))?$ {
|
||||
location ~ ^/mailer(?:/(.*))?$ {
|
||||
proxy_pass http://127.0.0.1:3003/$1$is_args$args;
|
||||
}
|
||||
|
||||
location ~ ^/(?:(.*))?$ {
|
||||
location ~ ^(?:/(.*))?$ {
|
||||
proxy_pass http://127.0.0.1:3001/$1$is_args$args;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,20 +23,16 @@ http {
|
|||
alias /usr/share/nginx/html;
|
||||
autoindex on;
|
||||
}
|
||||
|
||||
location ~ ^/auth/(?:(.*))?$ {
|
||||
location ~ ^/auth(?:/(.*))?$ {
|
||||
proxy_pass http://auth:3000/$1$is_args$args;
|
||||
}
|
||||
|
||||
location ~ ^/client/(?:(.*))?$ {
|
||||
location ~ ^/client(?:/(.*))?$ {
|
||||
proxy_pass http://client:3002/$1$is_args$args;
|
||||
}
|
||||
|
||||
location ~ ^/mailer/(?:(.*))?$ {
|
||||
location ~ ^/mailer(?:/(.*))?$ {
|
||||
proxy_pass http://mailer:3003/$1$is_args$args;
|
||||
}
|
||||
|
||||
location ~ ^/(?:(.*))?$ {
|
||||
location ~ ^(?:/(.*))?$ {
|
||||
proxy_pass http://salix:3001/$1$is_args$args;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue