mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-15 02:06:01 +08:00
update auhtorization code
This commit is contained in:
parent
8832f08fed
commit
911af03e0c
@ -194,7 +194,7 @@ const MCPDetailContent: FC<Props> = ({
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
{!isGettingTools && !toolList.length && (
|
||||
{detail.is_team_authorization && !isGettingTools && !toolList.length && (
|
||||
<div className='flex h-full w-full flex-col items-center justify-center'>
|
||||
<div className='system-sm-regular mb-3 text-text-tertiary'>{t('tools.mcp.toolsEmpty')}</div>
|
||||
<Button
|
||||
|
@ -41,7 +41,7 @@ const MCPList = ({
|
||||
}: Props) => {
|
||||
const searchParams = useSearchParams()
|
||||
const authCode = searchParams.get('code') || ''
|
||||
const providerID = decodeURIComponent(searchParams.get('state') || '').split('provider_id=')[1] || ''
|
||||
const providerID = searchParams.get('state') || ''
|
||||
|
||||
const { data: list = [], refetch } = useAllMCPTools()
|
||||
const { mutateAsync: authorizeMcp } = useAuthorizeMCP()
|
||||
@ -92,9 +92,9 @@ const MCPList = ({
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (authCode && providerID)
|
||||
if (authCode && providerID && list.length > 0)
|
||||
handleUpdateAuthorization(providerID, authCode)
|
||||
}, [authCode, providerID])
|
||||
}, [authCode, providerID, list])
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -28,7 +28,7 @@ const ProviderList = () => {
|
||||
|
||||
const searchParams = useSearchParams()
|
||||
const authCode = searchParams.get('code') || ''
|
||||
const providerID = decodeURIComponent(searchParams.get('state') || '').split('provider_id=')[1] || ''
|
||||
const providerID = searchParams.get('state') || ''
|
||||
|
||||
const [activeTab, setActiveTab] = useTabSearchParams({
|
||||
defaultTab: authCode && providerID ? 'mcp' : 'builtin',
|
||||
|
Loading…
x
Reference in New Issue
Block a user