Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
ce757d91
authored
Jun 21, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: ssr
parent
d592d4e9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
client/src/api/fetch.ts
+7
-1
client/src/pages/model/components/detail/index.tsx
+5
-4
No files found.
client/src/api/fetch.ts
View file @
ce757d91
...
@@ -22,6 +22,11 @@ export const streamFetch = ({ data, onMessage, abortSignal }: StreamFetchProps)
...
@@ -22,6 +22,11 @@ export const streamFetch = ({ data, onMessage, abortSignal }: StreamFetchProps)
})
})
});
});
if
(
response
.
status
!==
200
)
{
const
err
=
await
response
.
json
();
return
reject
(
err
);
}
if
(
!
response
?.
body
)
{
if
(
!
response
?.
body
)
{
throw
new
Error
(
'Request Error'
);
throw
new
Error
(
'Request Error'
);
}
}
...
@@ -98,7 +103,8 @@ export const streamFetch = ({ data, onMessage, abortSignal }: StreamFetchProps)
...
@@ -98,7 +103,8 @@ export const streamFetch = ({ data, onMessage, abortSignal }: StreamFetchProps)
};
};
read
();
read
();
}
catch
(
err
:
any
)
{
}
catch
(
err
:
any
)
{
console
.
log
(
err
,
'===='
);
console
.
log
(
err
);
reject
(
getErrText
(
err
,
'请求异常'
));
reject
(
getErrText
(
err
,
'请求异常'
));
}
}
});
});
client/src/pages/model/components/detail/index.tsx
View file @
ce757d91
...
@@ -7,15 +7,16 @@ import dynamic from 'next/dynamic';
...
@@ -7,15 +7,16 @@ import dynamic from 'next/dynamic';
import
Tabs
from
'@/components/Tabs'
;
import
Tabs
from
'@/components/Tabs'
;
import
Settings
from
'./components/Settings'
;
import
Settings
from
'./components/Settings'
;
import
{
defaultModel
}
from
'@/constants/model'
;
const
Kb
=
dynamic
(()
=>
import
(
'./components/Kb'
),
{
const
Kb
=
dynamic
(()
=>
import
(
'./components/Kb'
),
{
ssr
:
tru
e
ssr
:
fals
e
});
});
const
Share
=
dynamic
(()
=>
import
(
'./components/Share'
),
{
const
Share
=
dynamic
(()
=>
import
(
'./components/Share'
),
{
ssr
:
tru
e
ssr
:
fals
e
});
});
const
API
=
dynamic
(()
=>
import
(
'./components/API'
),
{
const
API
=
dynamic
(()
=>
import
(
'./components/API'
),
{
ssr
:
tru
e
ssr
:
fals
e
});
});
enum
TabEnum
{
enum
TabEnum
{
...
@@ -28,7 +29,7 @@ enum TabEnum {
...
@@ -28,7 +29,7 @@ enum TabEnum {
const
ModelDetail
=
({
modelId
}:
{
modelId
:
string
})
=>
{
const
ModelDetail
=
({
modelId
}:
{
modelId
:
string
})
=>
{
const
router
=
useRouter
();
const
router
=
useRouter
();
const
{
isPc
}
=
useGlobalStore
();
const
{
isPc
}
=
useGlobalStore
();
const
{
modelDetail
,
userInfo
}
=
useUserStore
();
const
{
modelDetail
=
defaultModel
,
userInfo
}
=
useUserStore
();
const
[
currentTab
,
setCurrentTab
]
=
useState
<
`
${
TabEnum
}
`
>
(
TabEnum
.
settings
);
const
[
currentTab
,
setCurrentTab
]
=
useState
<
`
${
TabEnum
}
`
>
(
TabEnum
.
settings
);
const
isOwner
=
useMemo
(
const
isOwner
=
useMemo
(
...
...
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