Commit ab0ec1d8 by HoMeTown

fix: 修复bug

parent 3ee6a1a3
...@@ -71,6 +71,8 @@ typings/ ...@@ -71,6 +71,8 @@ typings/
# Nuxt generate # Nuxt generate
dist dist
sdream-ai
# Serverless directories # Serverless directories
.serverless .serverless
......
...@@ -23,6 +23,7 @@ export default defineConfig({ ...@@ -23,6 +23,7 @@ export default defineConfig({
pluginSvgr(), pluginSvgr(),
], ],
dev: { dev: {
assetPrefix: '/sdream-ai',
// 与本地开发有关的选项 // 与本地开发有关的选项
}, },
html: { html: {
...@@ -54,8 +55,10 @@ export default defineConfig({ ...@@ -54,8 +55,10 @@ export default defineConfig({
}, },
}, },
output: { output: {
assetPrefix: '/sdream-ai',
// 与构建产物有关的选项 // 与构建产物有关的选项
distPath: { distPath: {
root: 'sdream-ai',
image: 'assets', image: 'assets',
svg: 'assets', svg: 'assets',
font: 'assets', font: 'assets',
......
...@@ -13,7 +13,7 @@ const App: React.FC = () => { ...@@ -13,7 +13,7 @@ const App: React.FC = () => {
<Provider store={store}> <Provider store={store}>
<ToastWrapper> <ToastWrapper>
<AuthProvider> <AuthProvider>
<Router> <Router basename="/sdream-ai">
<MainLayout> <MainLayout>
<AppRoutes /> <AppRoutes />
</MainLayout> </MainLayout>
......
...@@ -58,7 +58,7 @@ export function fetchStreamResponse(url: string, body: Record<string, any>, onMe ...@@ -58,7 +58,7 @@ export function fetchStreamResponse(url: string, body: Record<string, any>, onMe
fetch(url, { fetch(url, {
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'X-Token': JSON.parse(window.localStorage.getItem('__TOKEN__') as string) || '', 'X-Token': JSON.parse(window.localStorage.getItem('__TOKEN__') || ''),
}, },
method: 'POST', method: 'POST',
body: JSON.stringify(body), body: JSON.stringify(body),
......
...@@ -69,7 +69,7 @@ export const ConversationModal: React.FC<ConversationModalProps> = ({ isOpen, on ...@@ -69,7 +69,7 @@ export const ConversationModal: React.FC<ConversationModalProps> = ({ isOpen, on
aria-label="table" aria-label="table"
classNames={{ classNames={{
base: 'max-h-[520px] overflow-scroll', base: 'max-h-[520px] overflow-scroll',
table: 'min-h-[420px]', table: 'max-h-[420px]',
}} }}
> >
<TableHeader columns={tableColumns}> <TableHeader columns={tableColumns}>
......
...@@ -24,7 +24,7 @@ export const MarkdownDetail: React.FC<MarkdownDetailProps> = ({ children }) => { ...@@ -24,7 +24,7 @@ export const MarkdownDetail: React.FC<MarkdownDetailProps> = ({ children }) => {
</PhotoProvider> </PhotoProvider>
), ),
p(data): JSX.Element { p(data): JSX.Element {
return <p className="leading-[24px]" {...data} /> return <p className="leading-[24px] break-words" {...data} />
}, },
ul(data): JSX.Element { ul(data): JSX.Element {
return <ul className="mb-[24px]" {...data} /> return <ul className="mb-[24px]" {...data} />
......
...@@ -4,12 +4,12 @@ export const envConf = { ...@@ -4,12 +4,12 @@ export const envConf = {
proxyUrl: 'https://sit-sdream.insurbank.cn/sdream-api', proxyUrl: 'https://sit-sdream.insurbank.cn/sdream-api',
}, },
sit: { sit: {
apiUrl: '/api', apiUrl: 'https://sit-sdream.insurbank.cn/sdream-api',
proxyUrl: 'https://sit-sdream.insurbank.cn/sdream-api', proxyUrl: 'https://sit-sdream.insurbank.cn/sdream-api',
}, },
prod: { prod: {
apiUrl: '/api', apiUrl: 'https://sit-sdream.insurbank.cn/sdream-api',
proxyUrl: 'https://sit-sdream.insurbank.cn/sdream-api', proxyUrl: '',
}, },
} }
......
...@@ -36,9 +36,11 @@ export const ChatAnswerParser: React.FC<ChatAnswerParserProps> = ({ onTyping, on ...@@ -36,9 +36,11 @@ export const ChatAnswerParser: React.FC<ChatAnswerParserProps> = ({ onTyping, on
return () => clearTimeout(timer) return () => clearTimeout(timer)
} }
else { else {
if (answer.endAnswerFlag) {
setIsTyping(false) setIsTyping(false)
onComplate() onComplate()
} }
}
}, [answer, currentIndex]) }, [answer, currentIndex])
const handleStopTyping = async () => { const handleStopTyping = async () => {
......
...@@ -15,6 +15,7 @@ export interface Attachment { ...@@ -15,6 +15,7 @@ export interface Attachment {
} }
export interface Answer { export interface Answer {
endAnswerFlag?: boolean
isStopTyping?: boolean isStopTyping?: boolean
isShow: boolean isShow: boolean
answer: string answer: string
......
...@@ -28,8 +28,9 @@ const service = axios.create({ ...@@ -28,8 +28,9 @@ const service = axios.create({
service.interceptors.request.use( service.interceptors.request.use(
(config: any) => { (config: any) => {
const token = window.localStorage.getItem('__TOKEN__') || '""'
config.headers = { 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-Id': `${Date.now()}${Math.random().toString(36).substring(2)}`,
'X-Request-By': config.url, 'X-Request-By': config.url,
// 'X-App-Type': getAppType() || '', // 'X-App-Type': getAppType() || '',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment