sodistore home as default loggin page

This commit is contained in:
Yinyin Liu 2026-03-26 10:31:32 +01:00
parent cc1ec216ee
commit 812962ace0
1 changed files with 20 additions and 3 deletions

View File

@ -34,6 +34,11 @@ function App() {
const searchParams = new URLSearchParams(location.search); const searchParams = new URLSearchParams(location.search);
const username = searchParams.get('username'); const username = searchParams.get('username');
const { const {
accessToSalimax,
accessToSodiohome,
accessToSodistore,
accessToSodistoreGrid,
accessToSodistorePro,
setAccessToSalimax, setAccessToSalimax,
setAccessToSalidomo, setAccessToSalidomo,
setAccessToSodiohome, setAccessToSodiohome,
@ -42,6 +47,18 @@ function App() {
setAccessToSodistorePro setAccessToSodistorePro
} = useContext(ProductIdContext); } = useContext(ProductIdContext);
const defaultRoute = accessToSodiohome
? routes.sodiohome_installations
: accessToSodistorePro
? routes.sodistorepro_installations
: accessToSodistoreGrid
? routes.sodistoregrid_installations
: accessToSodistore
? routes.sodistore_installations
: accessToSalimax
? routes.installations
: routes.salidomo_installations;
const detectBrowserLanguage = (): string => { const detectBrowserLanguage = (): string => {
const browserLang = navigator.language?.toLowerCase() || ''; const browserLang = navigator.language?.toLowerCase() || '';
if (browserLang.startsWith('de')) return 'de'; if (browserLang.startsWith('de')) return 'de';
@ -186,11 +203,11 @@ function App() {
<Routes> <Routes>
<Route <Route
path={''} path={''}
element={<Navigate to={routes.installations}></Navigate>} element={<Navigate to={defaultRoute}></Navigate>}
></Route> ></Route>
<Route <Route
path={'login'} path={'login'}
element={<Navigate to={routes.installations}></Navigate>} element={<Navigate to={defaultRoute}></Navigate>}
></Route> ></Route>
<Route <Route
path="/" path="/"
@ -259,7 +276,7 @@ function App() {
<Route path={routes.users + '*'} element={<Users />} /> <Route path={routes.users + '*'} element={<Users />} />
<Route <Route
path={'*'} path={'*'}
element={<Navigate to={routes.installations}></Navigate>} element={<Navigate to={defaultRoute}></Navigate>}
></Route> ></Route>
<Route path="ResetPassword" element={<ResetPassword />}></Route> <Route path="ResetPassword" element={<ResetPassword />}></Route>
</Route> </Route>