Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
水玉婷
ai-wechat
Commits
c8ee53e3
Commit
c8ee53e3
authored
Nov 28, 2025
by
水玉婷
Browse files
feat:优化请求体
parent
b4dd2f2d
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/utils/axios.js
View file @
c8ee53e3
...
...
@@ -23,6 +23,7 @@ instance.interceptors.request.use(
try
{
config
.
headers
[
'
Token
'
]
=
userToken
||
''
config
.
headers
[
'
x-session-id
'
]
=
userToken
||
''
config
.
headers
[
'
x-app-code
'
]
=
import
.
meta
.
env
.
VITE_APP_CODE
||
''
}
catch
(
error
)
{
console
.
warn
(
'
解析用户信息失败
'
,
error
)
}
...
...
src/views/components/AiChat.vue
View file @
c8ee53e3
...
...
@@ -405,14 +405,7 @@ const sendMessage = async (type: MessageType = 'text', params: MessageParams = {
};
const
response
=
await
post
(
`
${
props
.
apiBaseUrl
}
/aiService/ask/app/
${
props
.
params
?.
appId
}
`
,
requestData
,
{
headers
:
{
Token
:
props
.
token
||
''
,
'
x-session-id
'
:
props
.
token
||
''
,
'
x-app-code
'
:
props
.
appCode
||
''
,
}
}
requestData
);
const
data
=
response
.
data
;
...
...
@@ -477,13 +470,7 @@ const getChatRecord = async (dialogSessionId: string) => {
messages
.
value
=
[...
recordList
];
}
}
else
{
const
response
=
await
get
(
`
${
props
.
apiBaseUrl
}
/aiService/ask/list/chat/
${
dialogSessionId
}
`
,
{
headers
:
{
Token
:
props
.
token
||
''
,
'
x-session-id
'
:
props
.
token
||
''
,
'
x-app-code
'
:
props
.
appCode
||
''
,
}
});
const
response
=
await
get
(
`
${
props
.
apiBaseUrl
}
/aiService/ask/list/chat/
${
dialogSessionId
}
`
);
const
data
=
response
.
data
;
if
(
data
.
code
===
0
)
{
...
...
src/views/components/utils/contentTemplateService.ts
View file @
c8ee53e3
import
dayjs
from
'
dayjs
'
;
import
{
tableTemplate
}
from
'
./tableTemplate
'
;
import
{
markdownTemplate
,
isLastBlockMarkdown
,
getLastMarkdownBlockIndex
,
mergeMarkdownContent
}
from
'
./markdownTemplate
'
;
...
...
@@ -426,7 +427,7 @@ export class ContentTemplateService {
const
result
:
Message
[]
=
[];
dataArray
.
forEach
((
data
)
=>
{
let
date
=
new
Date
(
data
.
startTime
).
toLocaleTimeString
(
);
let
date
=
dayjs
(
data
.
startTime
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
);
// 处理问题消息
if
(
data
.
question
||
data
.
audioPath
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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