diff --git a/src/app.tsx b/src/app.tsx
index a61c427..071ff59 100644
--- a/src/app.tsx
+++ b/src/app.tsx
@@ -42,7 +42,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
src: initialState?.currentUser?.userAvatar,
title: ,
render: (_, avatarChildren) => {
- return {avatarChildren};
+ return {avatarChildren};
},
},
waterMarkProps: {
@@ -111,8 +111,8 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
* @doc https://umijs.org/docs/max/request#配置
*/
export const request = {
-
- baseURL:"http://localhost:8101",
+
+ baseURL:"http://172.20.10.2:8101",
withCredentials:true,
...errorConfig,
};
diff --git a/src/components/RightContent/AvatarDropdown.tsx b/src/components/RightContent/AvatarDropdown.tsx
index b0e9bc8..f64d0b3 100644
--- a/src/components/RightContent/AvatarDropdown.tsx
+++ b/src/components/RightContent/AvatarDropdown.tsx
@@ -38,7 +38,8 @@ const useStyles = createStyles(({ token }) => {
};
});
-export const AvatarDropdown: React.FC = ({ menu, children }) => {
+export const AvatarDropdown: React.FC = ({ menu,initState, children }) => {
+
/**
* 退出登录,并且将当前的 url 保存
*/
@@ -89,11 +90,13 @@ export const AvatarDropdown: React.FC = ({ menu, childre
);
- if (!initialState) {
- return loading;
- }
+ // if (!initialState) {
+ // return loading;
+ // }
- const { currentUser } = initialState;
+ const { currentUser } = initState;
+
+ console.log('currentUser:',currentUser,initState)
if (!currentUser || !currentUser.userName) {
return loading;
@@ -135,4 +138,4 @@ export const AvatarDropdown: React.FC = ({ menu, childre
{children}
);
-};
\ No newline at end of file
+};