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
feafe8e8
Commit
feafe8e8
authored
Aug 23, 2024
by
HoMeTown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复首页样式的问题&登录失效的处理
parent
55d8a609
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
20 deletions
+29
-20
src/layouts/MainLayout/MainLayout.tsx
+4
-1
src/pages/Chat/components/ChatItem/ChatAnswerAttchment.tsx
+4
-3
src/pages/Home/Home.tsx
+19
-16
src/utils/request.ts
+2
-0
No files found.
src/layouts/MainLayout/MainLayout.tsx
View file @
feafe8e8
...
...
@@ -30,9 +30,12 @@ export const MainLayout: React.FC<MainLayoutProps> = ({ children }) => {
const
[
isHistoryVisible
,
setHistoryVisible
]
=
useState
(
false
)
const
location
=
useLocation
()
const
dispatch
=
useAppDispatch
()
const
token
=
window
.
localStorage
.
getItem
(
'__TOKEN__'
)
useEffect
(()
=>
{
dispatch
(
fetchConversations
())
if
(
token
)
{
dispatch
(
fetchConversations
())
}
},
[
dispatch
])
useEffect
(()
=>
{
...
...
src/pages/Chat/components/ChatItem/ChatAnswerAttchment.tsx
View file @
feafe8e8
...
...
@@ -27,11 +27,12 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
const
handleClickDocLink
=
async
(
docId
:
string
)
=>
{
if
(
fromParser
)
{
const
res
=
await
fetchGetDocumentLink
(
docId
)
if
(
res
.
data
)
window
.
location
.
href
=
res
.
data
.
docUrl
if
(
res
.
data
)
{
window
.
open
(
res
.
data
.
docUrl
)
}
}
else
{
window
.
location
.
href
=
docId
window
.
open
(
docId
)
}
}
return
(
...
...
src/pages/Home/Home.tsx
View file @
feafe8e8
import
type
React
from
'react'
import
{
Virtuoso
}
from
'react-virtuoso'
import
{
motion
}
from
'framer-motion'
import
styles
from
'./Home.module.less'
import
{
QuestionList
}
from
'./components/QuestionList'
...
...
@@ -54,26 +53,30 @@ export const Home: React.FC = () => {
<
GradientBackground
/>
<
div
className=
"h-full w-full"
>
<
div
className=
"box flex flex-col h-full w-full"
>
<
div
className=
"flex-1"
>
<
Virtuoso
<
div
className=
"flex-1 flex items-center overflow-y-scroll pt-[32px] scrollbar-hide sm:overflow-hidden"
>
<
div
className=
"w-full"
>
<
div
className=
"px-[24px] pb-[24px] sm:px-0"
>
{
/* slogan */
}
<
Slogan
/>
{
/* 欢迎语 */
}
<
div
className=
"gap-[20px] flex justify-center flex-row flex-wrap mt-[42px] sm:mt-[62px] lg:mt-[112px]"
>
<
motion
.
div
className=
"w-full hidden sm:block sm:w-auto"
{
...
getAnimationProps
(1)}
><
WelcomeWord
/></
motion
.
div
>
<
motion
.
div
className=
"w-full sm:w-auto"
{
...
getAnimationProps
(2)}
><
QuestionList
questions=
{
RECOMMEND_QUESTIONS_PRODUCT
}
dotColor=
"#D4CCFF"
title=
"产品问答"
iconImg=
{
HomeIcon1
}
/></
motion
.
div
>
<
motion
.
div
className=
"w-full sm:w-auto"
{
...
getAnimationProps
(3)}
><
QuestionList
questions=
{
RECOMMEND_QUESTIONS_OTHER
}
dotColor=
"#CBECFF"
title=
"其他问答"
iconImg=
{
HomeIcon2
}
/></
motion
.
div
>
</
div
>
</
div
>
</
div
>
{
/* pt-[42px] sm:pt-[80px] lg:pt-[180px] */
}
{
/* <Virtuoso
style={{ height: '100%' }}
className="scrollbar-hide"
totalCount={1}
itemContent={() => (
<
div
className=
"px-[24px] pb-[24px] pt-[42px] sm:pt-[80px] lg:pt-[180px] sm:px-0"
>
{
/* slogan */
}
<
Slogan
/>
{
/* 欢迎语 */
}
<
div
className=
"gap-[20px] flex justify-center flex-row flex-wrap mt-[42px] sm:mt-[62px] lg:mt-[112px]"
>
<
motion
.
div
className=
"w-full hidden sm:block sm:w-auto"
{
...
getAnimationProps
(1)}
><
WelcomeWord
/></
motion
.
div
>
<
motion
.
div
className=
"w-full sm:w-auto"
{
...
getAnimationProps
(2)}
><
QuestionList
questions=
{
RECOMMEND_QUESTIONS_PRODUCT
}
dotColor=
"#D4CCFF"
title=
"产品问答"
iconImg=
{
HomeIcon1
}
/></
motion
.
div
>
<
motion
.
div
className=
"w-full sm:w-auto"
{
...
getAnimationProps
(3)}
><
QuestionList
questions=
{
RECOMMEND_QUESTIONS_OTHER
}
dotColor=
"#CBECFF"
title=
"其他问答"
iconImg=
{
HomeIcon2
}
/></
motion
.
div
>
</
div
>
</
div
>
)
}
/>
)} */
}
{
/* /> */
}
</
div
>
<
div
className=
"box-border px-[0] mx-auto iptContainer w-full max-w-[1000px] flex-shrink-0 sm:px-0 pb-[18px]"
>
<
ChatEditor
onSubmit=
{
handleCreateConversation
}
placeholders=
{
RECOMMEND_QUESTIONS_OTHER
}
/>
...
...
src/utils/request.ts
View file @
feafe8e8
...
...
@@ -55,6 +55,8 @@ service.interceptors.response.use(
}
else
if
(
code
===
'00000005'
)
{
// 处理登录失效
window
.
localStorage
.
removeItem
(
'__TOKEN__'
)
window
.
location
.
reload
()
}
else
{
// showToast(message)
...
...
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