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
276e093c
Commit
276e093c
authored
Dec 05, 2025
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:收藏返回效果
parent
80f578fa
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
10 deletions
+16
-10
src/pages/Chat/Chat.tsx
+2
-1
src/pages/Chat/components/ChatWelcome/index.tsx
+9
-7
src/pages/Home/HomeNew.tsx
+5
-2
No files found.
src/pages/Chat/Chat.tsx
View file @
276e093c
...
...
@@ -101,7 +101,8 @@ export const Chat: React.FC = () => {
if
(
sessionStorage
.
getItem
(
'__INITIAL_FAQ_LOADED__'
))
return
sessionStorage
.
setItem
(
'__INITIAL_FAQ_LOADED__'
,
'true'
)
await
fetchEfficiencyQuestionList
({
toolId
:
''
})
const
sessionToolId
=
sessionStorage
.
getItem
(
'currentToolId'
)
||
''
await
fetchEfficiencyQuestionList
({
toolId
:
sessionToolId
})
}
catch
(
error
)
{
console
.
error
(
'初始化通用模式常见问题失败:'
,
error
)
...
...
src/pages/Chat/components/ChatWelcome/index.tsx
View file @
276e093c
...
...
@@ -7,20 +7,22 @@ interface ChatWelcomeProps {
toolName
?:
string
}
export
const
ChatWelcome
:
React
.
FC
<
ChatWelcomeProps
>
=
({
toolName
})
=>
{
export
const
ChatWelcome
:
React
.
FC
<
ChatWelcomeProps
>
=
({
toolName
:
_toolName
})
=>
{
const
viteOutputObj
=
import
.
meta
.
env
.
VITE_OUTPUT_OBJ
||
'open'
// 根据不同的 toolName 显示不同的提示语
const
getWelcomeText
=
()
=>
{
switch
(
toolName
)
{
case
'数据助手'
:
const
currentToolId
=
typeof
window
!==
'undefined'
?
sessionStorage
.
getItem
(
'currentToolId'
)
:
''
if
(
currentToolId
===
'6712395743240'
)
{
return
'HI~我是您的数据助手,可以帮你查询业务数据哦'
case
'提质增效'
:
}
if
(
currentToolId
===
'6712395743241'
)
{
return
'HI~我是您的提质增效助手,有什么可以帮您?'
case
'通用模式'
:
default
:
return
'您好,有什么我可以帮您的吗?'
}
return
'您好,有什么我可以帮您的吗?'
}
return
(
...
...
src/pages/Home/HomeNew.tsx
View file @
276e093c
...
...
@@ -107,8 +107,11 @@ export const Home: React.FC = () => {
finalToolId
=
storedToolId
||
urlToolId
}
// 调用真实 API 获取常见问题列表
const
res
=
await
fetchEfficiencyQuestionList
({
toolId
:
finalToolId
})
// 调用真实 API 获取常见问题列表,优先使用 sessionStorage 中的 currentToolId
const
sessionToolId
=
safeSessionStorageGetItem
(
'currentToolId'
)
||
''
const
res
=
await
fetchEfficiencyQuestionList
({
toolId
:
sessionToolId
||
finalToolId
,
})
if
(
res
&&
res
.
data
&&
res
.
data
.
questions
)
{
setOtherQuestions
((
prev
:
any
)
=>
({
...
prev
,
...
...
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