Forráskód Böngészése

联网搜索隐藏文件上传

S0025136190 5 hónapja
szülő
commit
9fcaac9169
1 módosított fájl, 72 hozzáadás és 69 törlés
  1. 72 69
      app/components/DeepSeekChat.tsx

+ 72 - 69
app/components/DeepSeekChat.tsx

@@ -1701,78 +1701,81 @@ function _Chat() {
             </div>
           </div>
           <div style={{ display: 'flex', alignItems: 'center' }}>
-            <div style={{ marginRight: 10 }}>
-              <Upload
-                {...uploadConfig}
-                showUploadList={false}
-                maxCount={1}
-                onChange={(info) => {
-                  const fileList = info.fileList.map((file) => {
-                    const data = file.response;
-                    return {
-                      ...file,
-                      url: data?.document_url || file.url,
-                      documentId: data?.document_id || '',
-                    }
-                  });
-                  setFileList(fileList);
-                  if (info.file.status === 'done') {// 上传成功
-                    const { code, message: msg } = info.file.response;
-                    if (code === 200) {
-                      message.success('上传成功');
-                    } else {
-                      message.error(msg);
+            {
+              !webSearch &&
+              <div style={{ marginRight: 10 }}>
+                <Upload
+                  {...uploadConfig}
+                  showUploadList={false}
+                  maxCount={1}
+                  onChange={(info) => {
+                    const fileList = info.fileList.map((file) => {
+                      const data = file.response;
+                      return {
+                        ...file,
+                        url: data?.document_url || file.url,
+                        documentId: data?.document_id || '',
+                      }
+                    });
+                    setFileList(fileList);
+                    if (info.file.status === 'done') {// 上传成功
+                      const { code, message: msg } = info.file.response;
+                      if (code === 200) {
+                        message.success('上传成功');
+                      } else {
+                        message.error(msg);
+                      }
+                    } else if (info.file.status === 'error') {// 上传失败
+                      message.error('上传失败');
                     }
-                  } else if (info.file.status === 'error') {// 上传失败
-                    message.error('上传失败');
-                  }
-                }}
-              >
-                <Tooltip
-                  title={
-                    <div style={{ padding: '4px 8px' }}>
-                      <div style={{
-                        fontSize: 12,
-                        lineHeight: 1.4,
-                        marginBottom: 6,
-                      }}>
-                        上传附件 (识别文本和图表中的内容)
-                      </div>
-                      <div style={{
-                        fontSize: 10,
-                        color: '#8c8c8c',
-                        lineHeight: 1.4,
-                      }}>
-                        <span>
-                          仅支持单个PDF/Word/TXT文件格式
-                        </span>
-                        <span>
-                          (单个文件≤50MB)
-                        </span>
-                      </div>
-                    </div>
-                  }
-                  placement="top"
+                  }}
                 >
-                  <div
-                    style={{
-                      width: 28,
-                      height: 28,
-                      borderRadius: '50%',
-                      background: '#4357d2',
-                      display: 'flex',
-                      justifyContent: 'center',
-                      alignItems: 'center',
-                      cursor: 'pointer',
-                      transition: 'all 0.2s ease',
-                      userSelect: 'none'
-                    }}
+                  <Tooltip
+                    title={
+                      <div style={{ padding: '4px 8px' }}>
+                        <div style={{
+                          fontSize: 12,
+                          lineHeight: 1.4,
+                          marginBottom: 6,
+                        }}>
+                          上传附件 (识别文本和图表中的内容)
+                        </div>
+                        <div style={{
+                          fontSize: 10,
+                          color: '#8c8c8c',
+                          lineHeight: 1.4,
+                        }}>
+                          <span>
+                            仅支持单个PDF/Word/TXT文件格式
+                          </span>
+                          <span>
+                            (单个文件≤50MB)
+                          </span>
+                        </div>
+                      </div>
+                    }
+                    placement="top"
                   >
-                    <PaperClipOutlined style={{ color: '#FFFFFF', fontSize: '18px' }} />
-                  </div>
-                </Tooltip>
-              </Upload>
-            </div>
+                    <div
+                      style={{
+                        width: 28,
+                        height: 28,
+                        borderRadius: '50%',
+                        background: '#4357d2',
+                        display: 'flex',
+                        justifyContent: 'center',
+                        alignItems: 'center',
+                        cursor: 'pointer',
+                        transition: 'all 0.2s ease',
+                        userSelect: 'none'
+                      }}
+                    >
+                      <PaperClipOutlined style={{ color: '#FFFFFF', fontSize: '18px' }} />
+                    </div>
+                  </Tooltip>
+                </Upload>
+              </div>
+            }
             <div
               style={{
                 width: 28,