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
a058d446
Commit
a058d446
authored
Jan 07, 2026
by
Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:工单busiId参数改为userid
parent
3b632092
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
34 deletions
+34
-34
src/pages/ChatTactics/TacticsChat.tsx
+16
-16
src/pages/ChatTactics/TacticsHome.tsx
+8
-8
src/pages/Home/HomeNew.tsx
+10
-10
No files found.
src/pages/ChatTactics/TacticsChat.tsx
View file @
a058d446
...
...
@@ -132,23 +132,23 @@ export const TacticsChat: React.FC = () => {
const
getConversationExtra
=
useCallback
(()
=>
{
if
(
orderMeta
)
{
console
.
log
(
'orderMeta'
,
orderMeta
)
// 从 localStorage 读取 user
Name
const
user
Name
FromStorage
=
safeLocalStorageGetItem
(
'__USER_NAME__'
)
let
user
Name
=
''
if
(
user
Name
FromStorage
)
{
// 从 localStorage 读取 user
Id
const
user
Id
FromStorage
=
safeLocalStorageGetItem
(
'__USER_NAME__'
)
let
user
Id
=
''
if
(
user
Id
FromStorage
)
{
try
{
// useLocalStorageState 会将值序列化为 JSON,需要解析
const
parsed
=
JSON
.
parse
(
user
Name
FromStorage
)
user
Name
=
parsed
||
userName
FromStorage
const
parsed
=
JSON
.
parse
(
user
Id
FromStorage
)
user
Id
=
parsed
||
userId
FromStorage
}
catch
{
// 如果不是 JSON 格式,直接使用原始值
user
Name
=
userName
FromStorage
user
Id
=
userId
FromStorage
}
}
return
{
busiType
:
'02'
,
busiId
:
user
Name
,
busiId
:
user
Id
,
workOrderIds
:
orderMeta
.
workOrderIds
,
}
as
Partial
<
any
>
}
...
...
@@ -446,21 +446,21 @@ export const TacticsChat: React.FC = () => {
// from=tactics 场景下补充业务识别参数
if
(
orderMeta
&&
shouldIncludeOrderMeta
)
{
requestBody
.
busiType
??
=
'02'
// 从 localStorage 读取 user
Name
const
user
Name
FromStorage
=
safeLocalStorageGetItem
(
'__USER_NAME__'
)
let
user
Name
=
''
if
(
user
Name
FromStorage
)
{
// 从 localStorage 读取 user
Id
const
user
Id
FromStorage
=
safeLocalStorageGetItem
(
'__USER_NAME__'
)
let
user
Id
=
''
if
(
user
Id
FromStorage
)
{
try
{
// useLocalStorageState 会将值序列化为 JSON,需要解析
const
parsed
=
JSON
.
parse
(
user
Name
FromStorage
)
user
Name
=
parsed
||
userName
FromStorage
const
parsed
=
JSON
.
parse
(
user
Id
FromStorage
)
user
Id
=
parsed
||
userId
FromStorage
}
catch
{
// 如果不是 JSON 格式,直接使用原始值
user
Name
=
userName
FromStorage
user
Id
=
userId
FromStorage
}
}
requestBody
.
busiId
=
user
Name
requestBody
.
busiId
=
user
Id
}
else
if
(
userMeta
?.
place
===
'user'
)
{
requestBody
.
busiType
??
=
'02'
...
...
src/pages/ChatTactics/TacticsHome.tsx
View file @
a058d446
...
...
@@ -75,23 +75,23 @@ export const TacticsHome: React.FC = () => {
// 仅用于创建会话的额外参数(对应 create_conversation)
const
getConversationExtra
=
useCallback
(()
=>
{
if
(
orderMeta
)
{
// 从 localStorage 读取 user
Name
const
user
Name
FromStorage
=
safeLocalStorageGetItem
(
'__USER_NAME__'
)
let
user
Name
=
''
if
(
user
Name
FromStorage
)
{
// 从 localStorage 读取 user
Id
const
user
Id
FromStorage
=
safeLocalStorageGetItem
(
'__USER_NAME__'
)
let
user
Id
=
''
if
(
user
Id
FromStorage
)
{
try
{
// useLocalStorageState 会将值序列化为 JSON,需要解析
const
parsed
=
JSON
.
parse
(
user
Name
FromStorage
)
user
Name
=
parsed
||
userName
FromStorage
const
parsed
=
JSON
.
parse
(
user
Id
FromStorage
)
user
Id
=
parsed
||
userId
FromStorage
}
catch
{
// 如果不是 JSON 格式,直接使用原始值
user
Name
=
userName
FromStorage
user
Id
=
userId
FromStorage
}
}
return
{
busiType
:
'02'
,
busiId
:
user
Name
,
busiId
:
user
Id
,
workOrderIds
:
orderMeta
.
workOrderIds
,
}
as
Partial
<
any
>
}
...
...
src/pages/Home/HomeNew.tsx
View file @
a058d446
...
...
@@ -295,17 +295,17 @@ export const Home: React.FC = () => {
console
.
error
(
'降级存储也失败:'
,
storageError
)
}
}
if
(
res
.
data
.
user
Name
)
{
if
(
res
.
data
.
user
Id
)
{
try
{
setUserName
(
res
.
data
.
user
Name
)
setUserName
(
res
.
data
.
user
Id
)
}
catch
{
// user
Name
存储失败时使用降级方案
// user
Id
存储失败时使用降级方案
try
{
safeLocalStorageSetItem
(
'__USER_NAME__'
,
JSON
.
stringify
(
res
.
data
.
user
Name
))
safeLocalStorageSetItem
(
'__USER_NAME__'
,
JSON
.
stringify
(
res
.
data
.
user
Id
))
}
catch
(
storageError
)
{
console
.
error
(
'user
Name
降级存储失败:'
,
storageError
)
console
.
error
(
'user
Id
降级存储失败:'
,
storageError
)
}
}
}
...
...
@@ -407,17 +407,17 @@ export const Home: React.FC = () => {
console
.
error
(
'降级存储也失败:'
,
storageError
)
}
}
if
(
res
.
data
.
user
Name
)
{
if
(
res
.
data
.
user
Id
)
{
try
{
setUserName
(
res
.
data
.
user
Name
)
setUserName
(
res
.
data
.
user
Id
)
}
catch
{
// user
Name
存储失败时使用降级方案
// user
Id
存储失败时使用降级方案
try
{
safeLocalStorageSetItem
(
'__USER_NAME__'
,
JSON
.
stringify
(
res
.
data
.
user
Name
))
safeLocalStorageSetItem
(
'__USER_NAME__'
,
JSON
.
stringify
(
res
.
data
.
user
Id
))
}
catch
(
storageError
)
{
console
.
error
(
'user
Name
降级存储失败:'
,
storageError
)
console
.
error
(
'user
Id
降级存储失败:'
,
storageError
)
}
}
}
...
...
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