lanjianrong 3 yıl önce
ebeveyn
işleme
7e85db6fb8
3 değiştirilmiş dosya ile 4 ekleme ve 5 silme
  1. 0 1
      config/config.ts
  2. 3 3
      src/app.tsx
  3. 1 1
      src/components/AnimateContent/index.tsx

+ 0 - 1
config/config.ts

@@ -17,7 +17,6 @@ export default defineConfig({
   request: {},
   initialState: {},
   access: {},
-  dva: {},
   mfsu: {},
   srcTranspiler: 'esbuild',
   fastRefresh: true,

+ 3 - 3
src/app.tsx

@@ -28,12 +28,12 @@ export async function getInitialState(): Promise<{
     return {
       fetchUserInfo,
       ...currentUser,
-      settings: { ...defaultSettings }
+      settings: {}
     }
   }
   return {
     fetchUserInfo,
-    settings: { ...defaultSettings }
+    settings: {}
   }
 }
 
@@ -125,6 +125,6 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
     onCollapse: (collapsed: boolean) => {
       setInitialState({ ...initialState, setting: { ...initialState.setting, collapsed } })
     },
-    ...initialState?.settings
+    ...defaultSettings
   }
 }

+ 1 - 1
src/components/AnimateContent/index.tsx

@@ -18,7 +18,7 @@ const AnimateContent: FC<PropsWithChildren<AnimateContentProps>> = ({
 }) => {
   const wrapHeight = document.querySelector('.ant-pro-page-container-warp')?.clientHeight || 0
   const {
-    initialState: { setting: { collapsed } = { collapsed: true } }
+    initialState: { setting: { collapsed } = { collapsed: false } }
   } = useModel('@@initialState')
   return (
     <div className={styles.pageContainer}>