Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
黄南光
/
wiki_knowledge
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 88efd118
authored
Jun 15, 2026
by
黄南光
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
前端加入session id
1 parent
bf7c818d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
frontend/src/app/page.tsx
frontend/src/app/page.tsx
View file @
88efd11
...
@@ -147,6 +147,7 @@ export default function EnterpriseWiki() {
...
@@ -147,6 +147,7 @@ export default function EnterpriseWiki() {
const [isLinting, setIsLinting] = useState(false);
const [isLinting, setIsLinting] = useState(false);
const [wikiLinks, setWikiLinks] = useState<string[]>([]);
const [wikiLinks, setWikiLinks] = useState<string[]>([]);
const [abortController, setAbortController] = useState<AbortController | null>(null);
const [abortController, setAbortController] = useState<AbortController | null>(null);
const [sessionId] = useState(() => "session-" + Date.now() + "-" + Math.random().toString(36).substring(2, 9));
const chatEndRef = useRef<HTMLDivElement>(null);
const chatEndRef = useRef<HTMLDivElement>(null);
const lintEndRef = useRef<HTMLDivElement>(null);
const lintEndRef = useRef<HTMLDivElement>(null);
...
@@ -188,8 +189,6 @@ export default function EnterpriseWiki() {
...
@@ -188,8 +189,6 @@ export default function EnterpriseWiki() {
useEffect(() => {
useEffect(() => {
fetchFiles(currentPage, pageSize, searchQuery, true);
fetchFiles(currentPage, pageSize, searchQuery, true);
const interval = setInterval(() => fetchFiles(currentPage, pageSize, searchQuery, false), 15000);
return () => clearInterval(interval);
}, [currentPage, pageSize, searchQuery, refreshTrigger]);
}, [currentPage, pageSize, searchQuery, refreshTrigger]);
const filteredFiles = useMemo(() => {
const filteredFiles = useMemo(() => {
...
@@ -654,7 +653,8 @@ export default function EnterpriseWiki() {
...
@@ -654,7 +653,8 @@ export default function EnterpriseWiki() {
headers: { "Content-Type": "application/json" },
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
body: JSON.stringify({
query: userMessage,
query: userMessage,
history: historyToSend
history: historyToSend,
sessionId: sessionId
}),
}),
signal: controller.signal,
signal: controller.signal,
});
});
...
@@ -920,6 +920,16 @@ export default function EnterpriseWiki() {
...
@@ -920,6 +920,16 @@ export default function EnterpriseWiki() {
</button>
</button>
)}
)}
</div>
</div>
<button
onClick={() => {
setCurrentPage(1);
setSearchQuery(searchInput);
setRefreshTrigger(prev => prev + 1);
}}
className="flex items-center gap-2 px-5 py-2.5 bg-blue-50 text-blue-600 rounded-xl cursor-pointer hover:bg-blue-100 transition font-bold text-sm h-[42px]"
>
查询
</button>
</div>
</div>
<button
<button
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment