XieYongHong 3 лет назад
Родитель
Сommit
e8f2a387be

+ 4 - 0
src/app.tsx

@@ -241,6 +241,10 @@ const MenuItemIcon = (
 // ProLayout 支持的api https://procomponents.ant.design/components/layout
 export const layout: RunTimeLayoutConfig = ({ initialState }) => {
   // console.log({ ...initialState });
+  // let ico:any = document.querySelector('link[rel="icon"]')
+  // if(ico!==null){
+  //   ico.href='https://t9.baidu.com/it/u=2615841454,1925018474&fm=218&app=126&size=f242,150&n=0&f=JPEG&fmt=auto?s=A0B46032495267E15A7D35CE000070A2&sec=1657645200&t=b98ebc7ac3073c248e57894e899d7ac1'
+  // }
   return {
     navTheme: 'light',
     headerTheme: 'light',

+ 1 - 1
src/pages/document.ejs

@@ -13,7 +13,7 @@
       content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
     />
     <title>Jetlinks</title>
-    <link rel="icon" href="<%= context.config.publicPath + 'favicon.ico' %>" type="image/x-icon" />
+    <link rel="icon" id="ico" href="<%= context.config.publicPath + 'favicon.ico' %>" type="image/x-icon" />
   </head>
   <body>
     <noscript>

+ 22 - 12
src/pages/home/index.tsx

@@ -22,18 +22,18 @@ const Home = () => {
     comprehensive: <Comprehensive />,
   };
 
-  useEffect(() => {
-    service.queryView().then((resp) => {
-      setLoading(false);
-      if (resp.status === 200) {
-        if (resp.result.length == 0) {
-          setCurrent('init');
-        } else {
-          setCurrent(resp.result[0]?.content);
-        }
-      }
-    });
-  }, []);
+  // useEffect(() => {
+  //   service.queryView().then((resp) => {
+  //     // setLoading(false);
+  //     if (resp.status === 200) {
+  //       if (resp.result.length == 0) {
+  //         setCurrent('init');
+  //       } else {
+  //         setCurrent(resp.result[0]?.content);
+  //       }
+  //     }
+  //   });
+  // }, []);
   useEffect(() => {
     service.userDetail().then((res) => {
       if (res.status === 200) {
@@ -49,6 +49,16 @@ const Home = () => {
           .then((response) => {
             if (response.status === 200) {
               setDetail(response.result?.data);
+              service.queryView().then((resp) => {
+                setLoading(false);
+                if (resp.status === 200) {
+                  if (resp.result.length == 0) {
+                    setCurrent('init');
+                  } else {
+                    setCurrent(resp.result[0]?.content);
+                  }
+                }
+              });
             }
           });
       }

+ 1 - 1
src/pages/notice/Config/Log/index.tsx

@@ -114,7 +114,7 @@ const Log = observer(() => {
           pageSize: 5,
         }}
         columns={columns}
-        request={async (params) => service.getHistoryLog(state.current?.id || '', params)}
+        request={async (params) => service.getHistoryLog(state.current?.id || '', { ...params, sorts: [{ name: 'notifyTime', order: 'desc' }] })}
       />
     </Modal>
   );

+ 1 - 1
src/pages/notice/Template/Log/index.tsx

@@ -118,7 +118,7 @@ const Log = observer(() => {
         }
         params={param}
         columns={columns}
-        request={async (params) => service.getHistoryLog(state.current?.id || '', params)}
+        request={async (params) => service.getHistoryLog(state.current?.id || '', { ...params, sorts: [{ name: 'notifyTime', order: 'desc' }] })}
       />
     </Modal>
   );

+ 7 - 1
src/pages/user/Login/index.tsx

@@ -56,9 +56,15 @@ const Login: React.FC = () => {
   const getCode = () => {
     delete loginForm.values?.verifyCode;
     loginRef.current = loginForm.values;
+    // setLoading(false);
     Service.captchaConfig()
       .pipe(
-        filter((r) => r.enabled),
+        filter((r) => {
+          if(!r.enabled){
+            setLoading(false)
+          }
+          return r.enabled
+        }),
         mergeMap(Service.getCaptcha),
         catchError(() => message.error('系统开小差,请稍后重试')),
       )