feat: Day 21-22 - knowledge base frontend completed, fix CORS and file upload issues
- Complete knowledge base list and detail pages - Complete document upload component - Fix CORS config (add PUT/DELETE method support) - Fix file upload issues (disabled state and beforeUpload return value) - Add detailed debug logs (cleaned up) - Create Day 21-22 completion summary document
This commit is contained in:
1
frontend/.gitignore
vendored
1
frontend/.gitignore
vendored
@@ -29,3 +29,4 @@ dist-ssr
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,3 +14,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -41,3 +41,4 @@
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,3 +7,4 @@ export default {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,3 +23,4 @@ export default {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -183,3 +183,4 @@ export const documentApi = {
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -80,3 +80,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -179,3 +179,4 @@ export default MessageInput;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -52,3 +52,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -113,3 +113,4 @@ const CreateKBDialog: React.FC<CreateKBDialogProps> = ({
|
||||
|
||||
export default CreateKBDialog;
|
||||
|
||||
|
||||
|
||||
@@ -209,3 +209,4 @@ const DocumentList: React.FC<DocumentListProps> = ({
|
||||
|
||||
export default DocumentList;
|
||||
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ const DocumentUpload: React.FC<DocumentUploadProps> = ({
|
||||
return Upload.LIST_IGNORE;
|
||||
}
|
||||
|
||||
return false; // 阻止自动上传,我们手动处理
|
||||
// 不返回任何值,让 customRequest 处理上传
|
||||
};
|
||||
|
||||
const customRequest: UploadProps['customRequest'] = async (options) => {
|
||||
|
||||
@@ -109,3 +109,4 @@ const EditKBDialog: React.FC<EditKBDialogProps> = ({
|
||||
|
||||
export default EditKBDialog;
|
||||
|
||||
|
||||
|
||||
@@ -201,3 +201,4 @@ const KnowledgeBaseList: React.FC<KnowledgeBaseListProps> = ({
|
||||
|
||||
export default KnowledgeBaseList;
|
||||
|
||||
|
||||
|
||||
@@ -23,3 +23,4 @@ body {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -18,3 +18,4 @@ ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ const KnowledgePage: React.FC = () => {
|
||||
<DocumentUpload
|
||||
kbId={currentKb.id}
|
||||
onUploadSuccess={handleUploadSuccess}
|
||||
disabled={loading}
|
||||
disabled={false}
|
||||
maxDocuments={50}
|
||||
currentDocumentCount={documents.length}
|
||||
/>
|
||||
|
||||
@@ -215,3 +215,4 @@ export const useKnowledgeBaseStore = create<KnowledgeBaseState>((set, get) => ({
|
||||
},
|
||||
}));
|
||||
|
||||
|
||||
|
||||
@@ -89,3 +89,4 @@ export interface ApiResponse<T = any> {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1
frontend/src/vite-env.d.ts
vendored
1
frontend/src/vite-env.d.ts
vendored
@@ -11,3 +11,4 @@ interface ImportMeta {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -15,3 +15,4 @@ export default {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -32,3 +32,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,3 +12,4 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -23,3 +23,4 @@ export default defineConfig({
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -13,3 +13,4 @@ pause
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user