S0025136190 7 mesiacov pred
rodič
commit
686b37f775
2 zmenil súbory, kde vykonal 33 pridanie a 30 odobranie
  1. 27 26
      app/components/chat.tsx
  2. 6 4
      app/components/sidebar.tsx

+ 27 - 26
app/components/chat.tsx

@@ -1604,28 +1604,29 @@ function _Chat() {
             }
           </div>
           <div>
-            {
-              appList.length > 1 ?
-                <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
-                  <Select
-                    style={{ width: '50%', height: 38, marginRight: 5 }}
-                    value={selectedFruit}
-                    onChange={(value: "ONLINE" | "LOCAL") => {
-                      chatStore.clearSessions();
-                      chatStore.updateCurrentSession((values) => {
-                        values.appId = globalStore.selectedAppId;
-                      });
-                      navigate({ pathname: '/newChat' });
-                      setSelectedFruit(value);
-                      chatStore.setChatMode(value);
-                    }}
-                  >
-                    {fruits.map(fruit => (
-                      <Select.Option key={fruit.id} value={fruit.id}>
-                        {fruit.name}
-                      </Select.Option>
-                    ))}
-                  </Select>
+
+            <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
+              <Select
+                style={{ width: '100%', height: 38, marginRight: 5 }}
+                value={selectedFruit}
+                onChange={(value: "ONLINE" | "LOCAL") => {
+                  chatStore.clearSessions();
+                  chatStore.updateCurrentSession((values) => {
+                    values.appId = globalStore.selectedAppId;
+                  });
+                  navigate({ pathname: '/newChat' });
+                  setSelectedFruit(value);
+                  chatStore.setChatMode(value);
+                }}
+              >
+                {fruits.map(fruit => (
+                  <Select.Option key={fruit.id} value={fruit.id}>
+                    {fruit.name}
+                  </Select.Option>
+                ))}
+              </Select>
+              {
+                appList.length > 1 ?
                   <Select
                     style={{ width: '100%', height: 38, marginRight: 5 }}
                     placeholder='请选择'
@@ -1647,10 +1648,10 @@ function _Chat() {
                       setSendStatus(false);
                     }}
                   />
-                </div>
-                :
-                null
-            }
+                  :
+                  null
+              }
+            </div>
           </div>
         </div>
 

+ 6 - 4
app/components/sidebar.tsx

@@ -221,10 +221,12 @@ export const SideBar = (props: { className?: string }) => {
       let url = '';
       if (getType() === 'bigModel') {
         const appId = globalStore.selectedAppId;
-        if (chatMode === 'LOCAL') {
-          url = `/takai/api/dialog/list/${appId}`;
-        } else {
-          url = `/bigmodel/api/dialog/list/${appId}`;
+        if (appId) {
+          if (chatMode === 'LOCAL') {
+            url = `/takai/api/dialog/list/${appId}`;
+          } else {
+            url = `/bigmodel/api/dialog/list/${appId}`;
+          }
         }
       } else {
         const appId = '1881269958412521255';