@asaleh37/ui-base 25.8.25 → 25.8.26-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/common/Login.tsx +2 -0
- package/src/layout/MainContent.tsx +51 -49
package/package.json
CHANGED
|
@@ -104,11 +104,13 @@ const Login: React.FC = () => {
|
|
|
104
104
|
const checkUserSession = async () => {
|
|
105
105
|
if (appInfo?.apiBaseUrl) {
|
|
106
106
|
if (userSession.isAuthenticated == null) {
|
|
107
|
+
const token = localStorage.getItem("TOKEN");
|
|
107
108
|
try {
|
|
108
109
|
let response = await axios.get(
|
|
109
110
|
`${appInfo.apiBaseUrl}/api/auth/userInfo`,
|
|
110
111
|
{
|
|
111
112
|
withCredentials: true,
|
|
113
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
112
114
|
}
|
|
113
115
|
);
|
|
114
116
|
if (response != null && response.data != null) {
|
|
@@ -36,7 +36,7 @@ const MainContent: React.FC = () => {
|
|
|
36
36
|
stores[storeKey]?.url != "" &&
|
|
37
37
|
stores[storeKey].autoLoad === true
|
|
38
38
|
) {
|
|
39
|
-
|
|
39
|
+
handleGetRequest({
|
|
40
40
|
endPointURI: stores[storeKey].url,
|
|
41
41
|
showMask: false,
|
|
42
42
|
successCallBkFn: (response) => {
|
|
@@ -61,55 +61,57 @@ const MainContent: React.FC = () => {
|
|
|
61
61
|
<CacheProvider
|
|
62
62
|
value={AppLayoutState.appDirection === "ltr" ? cacheLtr : cacheRtl}
|
|
63
63
|
>
|
|
64
|
-
{isAutoLoadLoaded ? (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
)
|
|
64
|
+
{/* {isAutoLoadLoaded ? ( */}
|
|
65
|
+
<Box
|
|
66
|
+
sx={{
|
|
67
|
+
display: "flex",
|
|
68
|
+
flexDirection: "column",
|
|
69
|
+
// alignItems: "center",
|
|
70
|
+
justifyContent: "flex-start",
|
|
71
|
+
flex: 1,
|
|
72
|
+
overflow: "hidden",
|
|
73
|
+
padding: 3,
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
<Routes>
|
|
77
|
+
{AppInfo.enableAdministrationModule
|
|
78
|
+
? SYSTEM_ROUTES.map((route: SystemRoute, index) => {
|
|
79
|
+
return (
|
|
80
|
+
<Route
|
|
81
|
+
key={"adm" + index}
|
|
82
|
+
path={route.path}
|
|
83
|
+
element={
|
|
84
|
+
<RouteWrapper
|
|
85
|
+
authority={route.authority}
|
|
86
|
+
applicationModule={route.applicationModule}
|
|
87
|
+
>
|
|
88
|
+
<route.component />
|
|
89
|
+
</RouteWrapper>
|
|
90
|
+
}
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
})
|
|
94
|
+
: null}
|
|
95
|
+
{businessRoutes.map((route: SystemRoute, index) => {
|
|
96
|
+
return (
|
|
97
|
+
<Route
|
|
98
|
+
key={"bs" + index}
|
|
99
|
+
path={route.path}
|
|
100
|
+
element={
|
|
101
|
+
<RouteWrapper authority={route.authority}>
|
|
102
|
+
<route.component />
|
|
103
|
+
</RouteWrapper>
|
|
104
|
+
}
|
|
105
|
+
/>
|
|
106
|
+
);
|
|
107
|
+
})}
|
|
108
|
+
</Routes>
|
|
109
|
+
</Box>
|
|
110
|
+
)
|
|
111
|
+
{/* : (
|
|
111
112
|
<></>
|
|
112
|
-
)
|
|
113
|
+
)
|
|
114
|
+
} */}
|
|
113
115
|
</CacheProvider>
|
|
114
116
|
);
|
|
115
117
|
};
|