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
2544e2a6
Commit
2544e2a6
authored
Jan 08, 2026
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:推荐问接口及参数
parent
1b9e87fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
30 deletions
+24
-30
src/pages/Chat/components/ChatItem/ChatAnswerRecommend.tsx
+24
-30
No files found.
src/pages/Chat/components/ChatItem/ChatAnswerRecommend.tsx
View file @
2544e2a6
...
...
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react'
import
{
useSearchParams
}
from
'react-router-dom'
import
{
Button
,
Skeleton
}
from
'@heroui/react'
import
type
{
Answer
}
from
'@/types/chat'
import
{
fetchOrderQueryRecommendQuestion
,
fetchQueryRecommendQuestion
}
from
'@/api/chat'
import
{
fetchOrderQueryRecommendQuestion
}
from
'@/api/chat'
import
SendIcon
from
'@/assets/svg/sendBlack.svg?react'
interface
ChatAnswerRecommendProps
{
...
...
@@ -20,49 +20,43 @@ export const ChatAnswerRecommend: React.FC<ChatAnswerRecommendProps> = ({ answer
onLoadingChange
?.(
true
)
// 从 sessionStorage 中获取 toolId
const
toolId
=
typeof
window
!==
'undefined'
?
sessionStorage
.
getItem
(
'currentToolId'
)
:
null
// 仅在 from=tactics 场景下,按照要求补充 busiType / recordType 参数
const
from
=
searchParams
.
get
(
'from'
)
const
place
=
searchParams
.
get
(
'place'
)
const
shouldAttachBusiParams
=
from
===
'tactics'
const
isOrderTactics
=
from
===
'tactics'
&&
place
===
'order'
const
isSpecialToolId
=
toolId
===
'6712395743241'
let
busiType
:
string
|
undefined
let
recordType
:
string
|
undefined
if
(
isSpecialToolId
)
{
// 制度活化:toolId 为空或不存在
if
(
!
toolId
)
{
busiType
=
'01'
recordType
=
'A17'
}
// 特殊工具ID
else
if
(
toolId
===
'6712395743241'
)
{
busiType
=
'01'
recordType
=
'A15'
}
else
if
(
shouldAttachBusiParams
)
{
// 策略场景
else
if
(
from
===
'tactics'
)
{
busiType
=
'02'
// from=tactics 且 place=order → recordType=A13 (使用 fetchOrderQueryRecommendQuestion)
if
(
isOrderTactics
)
{
recordType
=
'A13'
if
(
place
===
'user'
)
{
recordType
=
'A20'
}
// from=tactics 且 place=user → recordType=A03
else
if
(
place
===
'user'
)
{
recordType
=
'A03'
else
if
(
place
===
'order'
)
{
recordType
=
'A13'
}
// from=tactics 且 place!=user/无 → recordType=A01
else
{
recordType
=
'A
01
'
recordType
=
'A
19
'
}
}
try
{
const
res
=
(
isOrderTactics
||
isSpecialToolId
)
?
await
fetchOrderQueryRecommendQuestion
(
answer
.
conversationId
||
''
,
answer
.
recordId
||
''
,
toolId
||
undefined
,
busiType
,
recordType
,
)
:
await
fetchQueryRecommendQuestion
(
answer
.
conversationId
||
''
,
answer
.
recordId
||
''
,
toolId
||
undefined
,
busiType
,
recordType
,
)
const
res
=
await
fetchOrderQueryRecommendQuestion
(
answer
.
conversationId
||
''
,
answer
.
recordId
||
''
,
toolId
||
undefined
,
busiType
,
recordType
,
)
if
(
res
.
ok
)
{
setQuestionList
(
res
.
data
.
questionList
)
}
...
...
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