mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 03:32:23 +08:00
fix: cros promblem
This commit is contained in:
parent
6726ca102e
commit
36c01d89c9
|
@ -74,9 +74,8 @@ const PluginPage = ({
|
|||
(async () => {
|
||||
await sleep(100)
|
||||
if (packageId) {
|
||||
const data = await fetchManifestFromMarketPlace(encodeURIComponent(packageId))
|
||||
// wait for add cors
|
||||
setManifest(data)
|
||||
const { data } = await fetchManifestFromMarketPlace(encodeURIComponent(packageId))
|
||||
setManifest(data.plugin)
|
||||
showInstallFromMarketplace()
|
||||
}
|
||||
})()
|
||||
|
|
|
@ -290,11 +290,15 @@ const baseFetch = <T>(
|
|||
}: IOtherOptions,
|
||||
): Promise<T> => {
|
||||
const options: typeof baseOptions & FetchOptionType = Object.assign({}, baseOptions, fetchOptions)
|
||||
if (isMarketplaceAPI)
|
||||
options.credentials = 'omit'
|
||||
|
||||
if (getAbortController) {
|
||||
const abortController = new AbortController()
|
||||
getAbortController(abortController)
|
||||
options.signal = abortController.signal
|
||||
}
|
||||
|
||||
if (isPublicAPI) {
|
||||
const sharedToken = globalThis.location.pathname.split('/').slice(-1)[0]
|
||||
const accessToken = localStorage.getItem('token') || JSON.stringify({ [sharedToken]: '' })
|
||||
|
|
|
@ -80,7 +80,7 @@ export const fetchManifest = async (uniqueIdentifier: string) => {
|
|||
}
|
||||
|
||||
export const fetchManifestFromMarketPlace = async (uniqueIdentifier: string) => {
|
||||
return getMarketplace<PluginDeclaration>(`/plugins/identifier?unique_identifier=${uniqueIdentifier}`)
|
||||
return getMarketplace<{ data: { plugin: PluginDeclaration } }>(`/plugins/identifier?unique_identifier=${uniqueIdentifier}`)
|
||||
}
|
||||
|
||||
export const installPackageFromMarketPlace = async (uniqueIdentifier: string) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user