Procházet zdrojové kódy

Merge branch 'app-permission' of https://git.zyuas.com/LLM/chat-client-web into app-permission

sunsheng před 2 měsíci
rodič
revize
07fa0ab6a2
2 změnil soubory, kde provedl 10 přidání a 9 odebrání
  1. 2 2
      app/components/DeekSeekHome.tsx
  2. 8 7
      app/components/sidebar.tsx

+ 2 - 2
app/components/DeekSeekHome.tsx

@@ -155,7 +155,7 @@ const DeekSeek: React.FC = () => {
                                 }}
                                 key={index}
                             >
-                                <div style={{ whiteSpace: 'nowrap', marginRight: 20, color: '#98b4fa', cursor: 'pointer' }}>
+                                <div style={{ whiteSpace: 'nowrap', marginRight: 20, color: '#fff', cursor: 'pointer' }}>
                                     {item.title}
                                 </div>
                             </Dropdown>
@@ -180,7 +180,7 @@ const DeekSeek: React.FC = () => {
                                 window.open('https://llm.jkec.info:11431/deepseek/questionAnswer' + tokenParam, '_blank');
                             }}
                         >
-                            建科 • 小智开放平台
+                            应用广场
                         </button>
                     </div>
                 </div>

+ 8 - 7
app/components/sidebar.tsx

@@ -231,18 +231,18 @@ const AppDrawer: React.FC<AppDrawerProps> = (props) => {
     setListLoading(true);
     try {
       const res = await api.get(`/deepseek/api/project/app`);
-      // 确保 res.data 是数组,如果不是则设为空数组
-      const data = Array.isArray(res.data) ? res.data : [];
+      // // 确保 res.data 是数组,如果不是则设为空数组  error
+      // const data = Array.isArray(res.data) ? res.data : [];
       
       if (type === 'all') {
-        setList(data);
+        setList(res.data);
       } else {
-        setList(data.filter((item: any) => item.isCollect));
+        setList(res.data.filter((item: any) => item.isCollect));
       }
     } catch (error) {
       console.error(error);
-      // 出错时设置为空数组,避免渲染错误
-      setList([]);
+      // // 出错时设置为空数组,避免渲染错误  error
+      // setList([]);
     } finally {
       setListLoading(false);
     }
@@ -289,7 +289,8 @@ const AppDrawer: React.FC<AppDrawerProps> = (props) => {
       onClose={onClose}
     >
       {
-        Array.isArray(list) && list.length > 0 ?
+        list.length > 0 ?
+        // Array.isArray(list) && list.length > 0 ? //error
           list.map((item, index) => {
             return <div
               style={{