Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sdream-ai-fe
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
侯明涛
sdream-ai-fe
Commits
89aa960c
Commit
89aa960c
authored
Apr 15, 2026
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:编译报错
parent
bcc6ee16
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletions
+10
-1
src/lib/utils.ts
+9
-0
src/pages/Chat/Chat.tsx
+1
-1
No files found.
src/lib/utils.ts
View file @
89aa960c
...
@@ -380,3 +380,12 @@ export async function waitForToken(maxWaitTime = 3000): Promise<boolean> {
...
@@ -380,3 +380,12 @@ export async function waitForToken(maxWaitTime = 3000): Promise<boolean> {
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
300
))
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
300
))
return
true
return
true
}
}
export
function
normalizeToolIdForApi
(
toolId
:
unknown
):
string
{
if
(
typeof
toolId
!==
'string'
)
return
''
const
normalized
=
toolId
.
trim
()
if
(
!
normalized
||
normalized
===
'null'
||
normalized
===
'undefined'
)
return
''
return
normalized
}
src/pages/Chat/Chat.tsx
View file @
89aa960c
...
@@ -898,7 +898,7 @@ export const Chat: React.FC = () => {
...
@@ -898,7 +898,7 @@ export const Chat: React.FC = () => {
// 缓存无效或找不到工具时才调用接口
// 缓存无效或找不到工具时才调用接口
await
waitForToken
()
await
waitForToken
()
const
res
=
await
fetchToolList
(
{
userRoles
}
)
const
res
=
await
fetchToolList
()
if
(
res
?.
data
)
{
if
(
res
?.
data
)
{
const
tool
=
res
.
data
.
find
((
t
:
any
)
=>
t
.
toolId
===
currentToolId
)
const
tool
=
res
.
data
.
find
((
t
:
any
)
=>
t
.
toolId
===
currentToolId
)
if
(
tool
?.
toolName
)
{
if
(
tool
?.
toolName
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment