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
ab0ec1d8
Commit
ab0ec1d8
authored
Aug 14, 2024
by
HoMeTown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复bug
parent
3ee6a1a3
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
19 additions
and
10 deletions
+19
-10
.gitignore
+2
-0
rsbuild.config.ts
+3
-0
src/App.tsx
+1
-1
src/api/chat.ts
+1
-1
src/components/ConversationModal/index.tsx
+1
-1
src/components/MarkdownDetail/index.tsx
+1
-1
src/config/env.ts
+3
-3
src/pages/Chat/components/ChatItem/ChatAnswerParser.tsx
+4
-2
src/types/chat.ts
+1
-0
src/utils/request.ts
+2
-1
No files found.
.gitignore
View file @
ab0ec1d8
...
...
@@ -71,6 +71,8 @@ typings/
# Nuxt generate
dist
sdream-ai
# Serverless directories
.serverless
...
...
rsbuild.config.ts
View file @
ab0ec1d8
...
...
@@ -23,6 +23,7 @@ export default defineConfig({
pluginSvgr
(),
],
dev
:
{
assetPrefix
:
'/sdream-ai'
,
// 与本地开发有关的选项
},
html
:
{
...
...
@@ -54,8 +55,10 @@ export default defineConfig({
},
},
output
:
{
assetPrefix
:
'/sdream-ai'
,
// 与构建产物有关的选项
distPath
:
{
root
:
'sdream-ai'
,
image
:
'assets'
,
svg
:
'assets'
,
font
:
'assets'
,
...
...
src/App.tsx
View file @
ab0ec1d8
...
...
@@ -13,7 +13,7 @@ const App: React.FC = () => {
<
Provider
store=
{
store
}
>
<
ToastWrapper
>
<
AuthProvider
>
<
Router
>
<
Router
basename=
"/sdream-ai"
>
<
MainLayout
>
<
AppRoutes
/>
</
MainLayout
>
...
...
src/api/chat.ts
View file @
ab0ec1d8
...
...
@@ -58,7 +58,7 @@ export function fetchStreamResponse(url: string, body: Record<string, any>, onMe
fetch
(
url
,
{
headers
:
{
'Content-Type'
:
'application/json'
,
'X-Token'
:
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'__TOKEN__'
)
as
string
)
||
''
,
'X-Token'
:
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'__TOKEN__'
)
||
''
)
,
},
method
:
'POST'
,
body
:
JSON
.
stringify
(
body
),
...
...
src/components/ConversationModal/index.tsx
View file @
ab0ec1d8
...
...
@@ -69,7 +69,7 @@ export const ConversationModal: React.FC<ConversationModalProps> = ({ isOpen, on
aria
-
label=
"table"
classNames=
{
{
base
:
'max-h-[520px] overflow-scroll'
,
table
:
'm
in
-h-[420px]'
,
table
:
'm
ax
-h-[420px]'
,
}
}
>
<
TableHeader
columns=
{
tableColumns
}
>
...
...
src/components/MarkdownDetail/index.tsx
View file @
ab0ec1d8
...
...
@@ -24,7 +24,7 @@ export const MarkdownDetail: React.FC<MarkdownDetailProps> = ({ children }) => {
</
PhotoProvider
>
),
p
(
data
):
JSX
.
Element
{
return
<
p
className=
"leading-[24px]"
{
...
data
}
/>
return
<
p
className=
"leading-[24px]
break-words
"
{
...
data
}
/>
},
ul
(
data
):
JSX
.
Element
{
return
<
ul
className=
"mb-[24px]"
{
...
data
}
/>
...
...
src/config/env.ts
View file @
ab0ec1d8
...
...
@@ -4,12 +4,12 @@ export const envConf = {
proxyUrl
:
'https://sit-sdream.insurbank.cn/sdream-api'
,
},
sit
:
{
apiUrl
:
'
/
api'
,
apiUrl
:
'
https://sit-sdream.insurbank.cn/sdream-
api'
,
proxyUrl
:
'https://sit-sdream.insurbank.cn/sdream-api'
,
},
prod
:
{
apiUrl
:
'
/
api'
,
proxyUrl
:
'
https://sit-sdream.insurbank.cn/sdream-api
'
,
apiUrl
:
'
https://sit-sdream.insurbank.cn/sdream-
api'
,
proxyUrl
:
''
,
},
}
...
...
src/pages/Chat/components/ChatItem/ChatAnswerParser.tsx
View file @
ab0ec1d8
...
...
@@ -36,8 +36,10 @@ export const ChatAnswerParser: React.FC<ChatAnswerParserProps> = ({ onTyping, on
return
()
=>
clearTimeout
(
timer
)
}
else
{
setIsTyping
(
false
)
onComplate
()
if
(
answer
.
endAnswerFlag
)
{
setIsTyping
(
false
)
onComplate
()
}
}
},
[
answer
,
currentIndex
])
...
...
src/types/chat.ts
View file @
ab0ec1d8
...
...
@@ -15,6 +15,7 @@ export interface Attachment {
}
export
interface
Answer
{
endAnswerFlag
?:
boolean
isStopTyping
?:
boolean
isShow
:
boolean
answer
:
string
...
...
src/utils/request.ts
View file @
ab0ec1d8
...
...
@@ -28,8 +28,9 @@ const service = axios.create({
service
.
interceptors
.
request
.
use
(
(
config
:
any
)
=>
{
const
token
=
window
.
localStorage
.
getItem
(
'__TOKEN__'
)
||
'""'
config
.
headers
=
{
'X-Token'
:
JSON
.
parse
(
window
.
localStorage
.
getItem
(
'__TOKEN__'
)
||
''
),
'X-Token'
:
JSON
.
parse
(
token
),
'X-Request-Id'
:
`
${
Date
.
now
()}${
Math
.
random
().
toString
(
36
).
substring
(
2
)}
`
,
'X-Request-By'
:
config
.
url
,
// 'X-App-Type': getAppType() || '',
...
...
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