SubDomain ayarları
This commit is contained in:
parent
91be964a39
commit
c7c0b061a9
4 changed files with 22 additions and 12 deletions
|
|
@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict';
|
|||
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
||||
}, {
|
||||
"url": "index.html",
|
||||
"revision": "0.1jmha53s5bo"
|
||||
"revision": "0.fduoepfh2f"
|
||||
}], {});
|
||||
workbox.cleanupOutdatedCaches();
|
||||
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import appConfig from '@/configs/app.config'
|
|||
import dayjs from 'dayjs'
|
||||
import { components } from 'react-select'
|
||||
import { ROUTES_ENUM } from '@/routes/route.constant'
|
||||
import { hasSubdomain } from '@/utils/subdomain'
|
||||
|
||||
interface SimpleProps extends CommonProps {
|
||||
content?: ReactNode
|
||||
|
|
@ -92,6 +93,7 @@ const Simple = ({ children, content, ...rest }: SimpleProps) => {
|
|||
<Container className="flex flex-col flex-auto items-center justify-center min-w-0 h-full">
|
||||
<Card className="min-w-[320px] md:min-w-[450px]" bodyClass="md:p-10">
|
||||
<div className="flex justify-between items-center mb-4">
|
||||
{!hasSubdomain() && (
|
||||
<a
|
||||
href={ROUTES_ENUM.public.home}
|
||||
rel="noopener noreferrer"
|
||||
|
|
@ -99,10 +101,11 @@ const Simple = ({ children, content, ...rest }: SimpleProps) => {
|
|||
>
|
||||
<HiArrowLeft className="text-2xl" />
|
||||
</a>
|
||||
)}
|
||||
|
||||
<div className="w-12">
|
||||
<Select
|
||||
className='cursor-pointer'
|
||||
className="cursor-pointer"
|
||||
options={languageOptions}
|
||||
components={{
|
||||
Option: CustomSelectOption,
|
||||
|
|
|
|||
|
|
@ -44,7 +44,9 @@ export const DynamicRouter: React.FC = () => {
|
|||
</Route>
|
||||
|
||||
{dynamicRoutes
|
||||
.filter((r) => r.routeType !== 'protected')
|
||||
.filter((r) =>
|
||||
hasSubdomain() ? r.routeType === 'authenticated' : r.routeType !== 'protected',
|
||||
)
|
||||
.map((route) => {
|
||||
const Component = route.getComponent()
|
||||
return (
|
||||
|
|
@ -70,8 +72,12 @@ export const DynamicRouter: React.FC = () => {
|
|||
}
|
||||
/>
|
||||
|
||||
{/* Not Found */}
|
||||
<Route path="*" element={<NotFound />} />
|
||||
<Route
|
||||
path="*"
|
||||
element={
|
||||
hasSubdomain() ? <Navigate to={ROUTES_ENUM.authenticated.login} replace /> : <NotFound />
|
||||
}
|
||||
/>
|
||||
</Routes>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,5 +20,6 @@ export const getSubdomain = (): string | null => {
|
|||
}
|
||||
|
||||
export const hasSubdomain = (): boolean => {
|
||||
return true
|
||||
return getSubdomain() !== null
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue