From 94470915daf97f387269ad9fe011344776c7ab3c Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 15 Jul 2024 08:21:54 +0200 Subject: [PATCH 1/3] feat: redirect to lilium page not found --- front/salix/routes.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/front/salix/routes.js b/front/salix/routes.js index be210b749..ee3a9cd10 100644 --- a/front/salix/routes.js +++ b/front/salix/routes.js @@ -4,7 +4,14 @@ import getMainRoute from 'core/lib/get-main-route'; config.$inject = ['$stateProvider', '$urlRouterProvider']; function config($stateProvider, $urlRouterProvider) { $urlRouterProvider - .otherwise('/'); + .otherwise(async($injector, {$location}) => { + const url = $location.$$absUrl + .replace('5000', '9000') + .replace('salix', 'lilium') + .replace('#!', '#') + .replace('client', 'customer'); + window.location.href = url; + }); $stateProvider .state('layout', { From eb18bd2400ccd0e27d721b41c297803b84dfebd3 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 23 Jul 2024 13:57:14 +0200 Subject: [PATCH 2/3] fix: without path --- front/salix/routes.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/front/salix/routes.js b/front/salix/routes.js index ee3a9cd10..37247d93f 100644 --- a/front/salix/routes.js +++ b/front/salix/routes.js @@ -5,6 +5,8 @@ config.$inject = ['$stateProvider', '$urlRouterProvider']; function config($stateProvider, $urlRouterProvider) { $urlRouterProvider .otherwise(async($injector, {$location}) => { + if (!$location.$$path) return window.location.href = '/#!/'; + const url = $location.$$absUrl .replace('5000', '9000') .replace('salix', 'lilium') From 4f321340017a13f0fdbd0325b656c31aa532d808 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 23 Jul 2024 14:19:20 +0200 Subject: [PATCH 3/3] add prefix --- front/salix/routes.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/front/salix/routes.js b/front/salix/routes.js index 37247d93f..2c6f1b848 100644 --- a/front/salix/routes.js +++ b/front/salix/routes.js @@ -5,12 +5,13 @@ config.$inject = ['$stateProvider', '$urlRouterProvider']; function config($stateProvider, $urlRouterProvider) { $urlRouterProvider .otherwise(async($injector, {$location}) => { - if (!$location.$$path) return window.location.href = '/#!/'; + const prefix = '#!'; + if (!$location.$$path) return window.location.href = `/${prefix}/`; const url = $location.$$absUrl .replace('5000', '9000') .replace('salix', 'lilium') - .replace('#!', '#') + .replace(prefix, '#') .replace('client', 'customer'); window.location.href = url; });