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
0beb52a2
authored
Jan 11, 2026
by
Archer
Committed by
GitHub
Jan 11, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: plugin redirect (#6232)
parent
e8eba630
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
34 deletions
+2
-34
projects/app/src/pages/api/marketplace/[...path].ts
+2
-0
projects/app/src/pages/api/plugin/[...pluginRequestPath].ts
+0
-34
No files found.
projects/app/src/pages/api/marketplace/[...path].ts
View file @
0beb52a2
import
type
{
NextApiRequest
,
NextApiResponse
}
from
'next'
;
import
type
{
NextApiRequest
,
NextApiResponse
}
from
'next'
;
import
{
jsonRes
}
from
'@fastgpt/service/common/response'
;
import
{
jsonRes
}
from
'@fastgpt/service/common/response'
;
import
{
Readable
}
from
'stream'
;
import
{
Readable
}
from
'stream'
;
import
{
authSystemAdmin
}
from
'@fastgpt/service/support/permission/user/auth'
;
export
default
async
function
handler
(
req
:
NextApiRequest
,
res
:
NextApiResponse
)
{
export
default
async
function
handler
(
req
:
NextApiRequest
,
res
:
NextApiResponse
)
{
try
{
try
{
await
authSystemAdmin
({
req
});
const
{
path
=
[],
...
query
}
=
req
.
query
as
any
;
const
{
path
=
[],
...
query
}
=
req
.
query
as
any
;
const
queryStr
=
new
URLSearchParams
(
query
).
toString
();
const
queryStr
=
new
URLSearchParams
(
query
).
toString
();
...
...
projects/app/src/pages/api/plugin/[...pluginRequestPath].ts
deleted
100644 → 0
View file @
e8eba630
import
type
{
ApiRequestProps
,
ApiResponseType
}
from
'@fastgpt/service/type/next'
;
import
{
PLUGIN_BASE_URL
,
PLUGIN_TOKEN
}
from
'@fastgpt/service/thirdProvider/fastgptPlugin'
;
export
type
PluginQuery
=
{
pluginRequestPath
:
string
[];
};
export
type
PluginBody
=
{};
export
type
PluginResponse
=
{};
async
function
handler
(
req
:
ApiRequestProps
<
PluginBody
,
PluginQuery
>
,
res
:
ApiResponseType
<
any
>
)
{
const
{
pluginRequestPath
}
=
req
.
query
;
const
urlObj
=
new
URL
(
pluginRequestPath
.
join
(
'/'
),
PLUGIN_BASE_URL
);
Object
.
entries
(
req
.
query
).
forEach
(([
key
,
value
])
=>
{
if
(
key
!==
'pluginRequestPath'
)
{
urlObj
.
searchParams
.
set
(
key
,
String
(
value
));
}
});
const
body
=
req
.
method
?.
toUpperCase
()
===
'POST'
||
req
.
method
===
'PUT'
?
JSON
.
stringify
(
req
.
body
)
:
undefined
;
const
pluginRes
=
await
fetch
(
urlObj
.
toString
(),
{
method
:
req
.
method
,
body
,
headers
:
{
authtoken
:
PLUGIN_TOKEN
,
'Content-Type'
:
'application/json'
}
});
res
.
status
(
pluginRes
.
status
);
res
.
json
(
await
pluginRes
.
json
());
}
export
default
handler
;
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