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