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
a12ce805
Commit
a12ce805
authored
Jan 05, 2026
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:工单欢迎语&&传参
parent
4a0bef4a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
6 deletions
+36
-6
src/pages/ChatTactics/TacticsChat.tsx
+16
-2
src/pages/ChatTactics/TacticsHome.tsx
+16
-2
src/pages/ChatTactics/components/TacticsWelcome/index.tsx
+4
-2
No files found.
src/pages/ChatTactics/TacticsChat.tsx
View file @
a12ce805
...
@@ -137,7 +137,7 @@ export const TacticsChat: React.FC = () => {
...
@@ -137,7 +137,7 @@ export const TacticsChat: React.FC = () => {
}
}
return
{
return
{
busiType
:
'02'
,
busiType
:
'02'
,
busiId
:
userName
,
// 如果 userName
不存在,使用默认值 '8'
busiId
:
userName
,
// 如果 userName
}
as
Partial
<
any
>
}
as
Partial
<
any
>
}
}
if
(
userMeta
?.
place
===
'user'
)
{
if
(
userMeta
?.
place
===
'user'
)
{
...
@@ -427,7 +427,21 @@ export const TacticsChat: React.FC = () => {
...
@@ -427,7 +427,21 @@ export const TacticsChat: React.FC = () => {
// from=tactics 场景下补充业务识别参数
// from=tactics 场景下补充业务识别参数
if
(
orderMeta
&&
shouldIncludeOrderMeta
)
{
if
(
orderMeta
&&
shouldIncludeOrderMeta
)
{
requestBody
.
busiType
??
=
'02'
requestBody
.
busiType
??
=
'02'
// from=order 场景下,不传 busiId
// 从 localStorage 读取 userName
const
userNameFromStorage
=
safeLocalStorageGetItem
(
'__USER_NAME__'
)
let
userName
=
''
if
(
userNameFromStorage
)
{
try
{
// useLocalStorageState 会将值序列化为 JSON,需要解析
const
parsed
=
JSON
.
parse
(
userNameFromStorage
)
userName
=
parsed
||
userNameFromStorage
}
catch
{
// 如果不是 JSON 格式,直接使用原始值
userName
=
userNameFromStorage
}
}
requestBody
.
busiId
=
userName
}
}
else
if
(
userMeta
?.
place
===
'user'
)
{
else
if
(
userMeta
?.
place
===
'user'
)
{
requestBody
.
busiType
??
=
'02'
requestBody
.
busiType
??
=
'02'
...
...
src/pages/ChatTactics/TacticsHome.tsx
View file @
a12ce805
...
@@ -74,9 +74,23 @@ export const TacticsHome: React.FC = () => {
...
@@ -74,9 +74,23 @@ export const TacticsHome: React.FC = () => {
// 仅用于创建会话的额外参数(对应 create_conversation)
// 仅用于创建会话的额外参数(对应 create_conversation)
const
getConversationExtra
=
useCallback
(()
=>
{
const
getConversationExtra
=
useCallback
(()
=>
{
if
(
orderMeta
)
{
if
(
orderMeta
)
{
// 从 localStorage 读取 userName
const
userNameFromStorage
=
safeLocalStorageGetItem
(
'__USER_NAME__'
)
let
userName
=
''
if
(
userNameFromStorage
)
{
try
{
// useLocalStorageState 会将值序列化为 JSON,需要解析
const
parsed
=
JSON
.
parse
(
userNameFromStorage
)
userName
=
parsed
||
userNameFromStorage
}
catch
{
// 如果不是 JSON 格式,直接使用原始值
userName
=
userNameFromStorage
}
}
return
{
return
{
busiType
:
'02'
,
busiType
:
'02'
,
// from=order 场景下,不传 busiId
busiId
:
userName
,
}
as
Partial
<
any
>
}
as
Partial
<
any
>
}
}
if
(
userMeta
?.
place
===
'user'
)
{
if
(
userMeta
?.
place
===
'user'
)
{
...
@@ -122,7 +136,7 @@ export const TacticsHome: React.FC = () => {
...
@@ -122,7 +136,7 @@ export const TacticsHome: React.FC = () => {
}
}
window
.
localStorage
.
setItem
(
storageKey
,
conversationId
)
window
.
localStorage
.
setItem
(
storageKey
,
conversationId
)
}
}
// eslint-disable-next-line no-console
console
.
log
(
'[TacticsHome] created conversationId'
,
conversationId
)
console
.
log
(
'[TacticsHome] created conversationId'
,
conversationId
)
})
})
}
}
...
...
src/pages/ChatTactics/components/TacticsWelcome/index.tsx
View file @
a12ce805
...
@@ -4,6 +4,7 @@ import { motion } from 'framer-motion'
...
@@ -4,6 +4,7 @@ import { motion } from 'framer-motion'
import
{
useSearchParams
}
from
'react-router-dom'
import
{
useSearchParams
}
from
'react-router-dom'
import
AvatarBot
from
'@/assets/avatarBot.png'
import
AvatarBot
from
'@/assets/avatarBot.png'
import
AIIcon
from
'@/assets/ai-icon.png'
import
AIIcon
from
'@/assets/ai-icon.png'
import
{
safeSessionStorageGetItem
}
from
'@/lib/utils'
interface
TacticsWelcomeProps
{
interface
TacticsWelcomeProps
{
cleared
?:
boolean
cleared
?:
boolean
...
@@ -13,8 +14,9 @@ export const TacticsWelcome: React.FC<TacticsWelcomeProps> = ({ cleared }) => {
...
@@ -13,8 +14,9 @@ export const TacticsWelcome: React.FC<TacticsWelcomeProps> = ({ cleared }) => {
const
viteOutputObj
=
import
.
meta
.
env
.
VITE_OUTPUT_OBJ
||
'open'
const
viteOutputObj
=
import
.
meta
.
env
.
VITE_OUTPUT_OBJ
||
'open'
const
[
searchParams
]
=
useSearchParams
()
const
[
searchParams
]
=
useSearchParams
()
const
from
=
searchParams
.
get
(
'from'
)
const
from
=
searchParams
.
get
(
'from'
)
const
place
=
searchParams
.
get
(
'place'
)
// 直接从 sessionStorage 读取 place
const
isOrderPlace
=
from
===
'tactics'
&&
place
===
'order'
const
placeFromCache
=
safeSessionStorageGetItem
(
'__TACTICS_PLACE__'
)
const
isOrderPlace
=
from
===
'tactics'
&&
placeFromCache
===
'order'
const
welcomeText
=
cleared
const
welcomeText
=
cleared
?
'暂无分析记录,点击右上方按钮开始新的分析吧!'
?
'暂无分析记录,点击右上方按钮开始新的分析吧!'
...
...
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