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
3924711e
Commit
3924711e
authored
Jan 09, 2026
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:获取id接口增加toolId
parent
8fa948d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
src/api/conversation.ts
+3
-0
src/store/conversationSlice.ts
+3
-1
src/store/tacticsSlice.ts
+6
-1
No files found.
src/api/conversation.ts
View file @
3924711e
import
http
from
'@/utils/request'
import
http
from
'@/utils/request'
import
{
safeSessionStorageGetItem
}
from
'@/lib/utils'
/**
/**
* 查询用户历史会话列表
* 查询用户历史会话列表
...
@@ -39,10 +40,12 @@ export function fetchDeleteUserConversation(conversationIdList: string[]) {
...
@@ -39,10 +40,12 @@ export function fetchDeleteUserConversation(conversationIdList: string[]) {
* @params
* @params
*/
*/
export
function
fetchSessionConversationId
<
T
>
(
data
:
T
)
{
export
function
fetchSessionConversationId
<
T
>
(
data
:
T
)
{
const
toolId
=
safeSessionStorageGetItem
(
'currentToolId'
)
||
''
const
requestData
=
{
const
requestData
=
{
...(
data
as
Record
<
string
,
any
>
),
...(
data
as
Record
<
string
,
any
>
),
busiType
:
'01'
,
busiType
:
'01'
,
busiId
:
(
data
as
Record
<
string
,
any
>
)?.
busiId
||
''
,
busiId
:
(
data
as
Record
<
string
,
any
>
)?.
busiId
||
''
,
toolId
,
}
}
return
http
.
post
(
'/conversation/api/conversation/mobile/v1/get_user_conversation_session'
,
requestData
)
return
http
.
post
(
'/conversation/api/conversation/mobile/v1/get_user_conversation_session'
,
requestData
)
}
}
src/store/conversationSlice.ts
View file @
3924711e
...
@@ -70,12 +70,14 @@ export const createConversation = createAsyncThunk<
...
@@ -70,12 +70,14 @@ export const createConversation = createAsyncThunk<
// 从缓存中获取 toolId 作为 busiId
// 从缓存中获取 toolId 作为 busiId
const
cachedToolId
=
typeof
window
!==
'undefined'
?
sessionStorage
.
getItem
(
'currentToolId'
)
:
null
const
cachedToolId
=
typeof
window
!==
'undefined'
?
sessionStorage
.
getItem
(
'currentToolId'
)
:
null
const
busiId
=
cachedToolId
||
''
const
busiId
=
cachedToolId
||
''
const
toolId
=
cachedToolId
||
''
// 排除 toolId 字段,只传递 busiId 和 busiType
// 排除 toolId 字段,只传递 busiId 和 busiType
const
{
toolId
,
...
restConversationData
}
=
conversationData
const
{
toolId
:
_
,
...
restConversationData
}
=
conversationData
const
requestPayload
=
{
const
requestPayload
=
{
...
restConversationData
,
...
restConversationData
,
busiId
,
busiId
,
busiType
:
'01'
,
busiType
:
'01'
,
toolId
,
}
}
const
response
=
await
fetchCreateConversation
(
requestPayload
)
const
response
=
await
fetchCreateConversation
(
requestPayload
)
const
newConversation
=
response
.
data
const
newConversation
=
response
.
data
...
...
src/store/tacticsSlice.ts
View file @
3924711e
...
@@ -49,7 +49,12 @@ export const createTacticsConversation = createAsyncThunk<
...
@@ -49,7 +49,12 @@ export const createTacticsConversation = createAsyncThunk<
'tactics/createTacticsConversation'
,
'tactics/createTacticsConversation'
,
async
({
conversationData
,
shouldNavigate
,
shouldSendQuestion
},
{
dispatch
})
=>
{
async
({
conversationData
,
shouldNavigate
,
shouldSendQuestion
},
{
dispatch
})
=>
{
await
waitForToken
()
await
waitForToken
()
const
response
=
await
fetchCreateTacticsConversation
(
conversationData
)
// 从 sessionStorage 获取 toolId
const
toolId
=
typeof
window
!==
'undefined'
?
sessionStorage
.
getItem
(
'currentToolId'
)
:
null
const
response
=
await
fetchCreateTacticsConversation
({
...
conversationData
,
...(
toolId
?
{
toolId
}
:
{}),
})
const
newConversation
=
response
.
data
const
newConversation
=
response
.
data
await
dispatch
(
fetchTacticsConversations
())
await
dispatch
(
fetchTacticsConversations
())
...
...
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