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
38e4a41c
authored
Aug 16, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
google search docs
parent
2c174aa9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
2 additions
and
39 deletions
+2
-39
client/src/service/response.ts
+2
-2
client/src/utils/plugin/google.ts
+0
-37
docSite/docs/flow-modules/examples/imgs/google_search_1.png
+0
-0
docSite/docs/flow-modules/examples/imgs/google_search_2.png
+0
-0
docSite/docs/flow-modules/examples/web_search_google.md
+0
-0
docSite/i18n/zh-Hans/docusaurus-plugin-content-docs/current/flow-modules/examples/imgs/google_search_1.png
+0
-0
docSite/i18n/zh-Hans/docusaurus-plugin-content-docs/current/flow-modules/examples/imgs/google_search_2.png
+0
-0
docSite/i18n/zh-Hans/docusaurus-plugin-content-docs/current/flow-modules/examples/web_search_google.md
+0
-0
No files found.
client/src/service/response.ts
View file @
38e4a41c
...
@@ -52,7 +52,7 @@ export const jsonRes = <T = any>(
...
@@ -52,7 +52,7 @@ export const jsonRes = <T = any>(
}
else
if
(
openaiError
[
error
?.
response
?.
statusText
])
{
}
else
if
(
openaiError
[
error
?.
response
?.
statusText
])
{
msg
=
openaiError
[
error
.
response
.
statusText
];
msg
=
openaiError
[
error
.
response
.
statusText
];
}
}
console
.
log
(
error
?.
response
);
console
.
log
(
error
);
}
}
res
.
status
(
code
).
json
({
res
.
status
(
code
).
json
({
...
@@ -92,7 +92,7 @@ export const sseErrRes = (res: NextApiResponse, error: any) => {
...
@@ -92,7 +92,7 @@ export const sseErrRes = (res: NextApiResponse, error: any) => {
}
else
if
(
openaiError
[
error
?.
response
?.
statusText
])
{
}
else
if
(
openaiError
[
error
?.
response
?.
statusText
])
{
msg
=
openaiError
[
error
.
response
.
statusText
];
msg
=
openaiError
[
error
.
response
.
statusText
];
}
}
console
.
log
(
'sse error => '
,
error
?.
response
);
console
.
log
(
'sse error => '
,
error
);
sseResponse
({
sseResponse
({
res
,
res
,
...
...
client/src/utils/plugin/google.ts
deleted
100644 → 0
View file @
2c174aa9
import
axios
from
'axios'
;
import
{
Obj2Query
}
from
'../tools'
;
export
const
getClientToken
=
(
googleClientVerKey
?:
string
)
=>
{
if
(
!
googleClientVerKey
||
typeof
window
.
grecaptcha
===
'undefined'
||
!
window
.
grecaptcha
?.
ready
)
return
''
;
return
new
Promise
<
string
>
((
resolve
,
reject
)
=>
{
window
.
grecaptcha
.
ready
(
async
()
=>
{
try
{
const
token
=
await
window
.
grecaptcha
.
execute
(
googleClientVerKey
,
{
action
:
'submit'
});
resolve
(
token
);
}
catch
(
error
)
{
reject
(
error
);
}
});
});
};
// service run
export
const
authGoogleToken
=
async
(
data
:
{
secret
:
string
;
response
:
string
;
remoteip
?:
string
;
})
=>
{
const
res
=
await
axios
.
post
<
{
score
?:
number
;
success
:
boolean
;
'error-codes'
:
string
[];
}
>
(
`https://www.recaptcha.net/recaptcha/api/siteverify?
${
Obj2Query
(
data
)}
`
);
if
(
res
.
data
.
success
)
{
return
Promise
.
resolve
(
''
);
}
return
Promise
.
reject
(
res
?.
data
?.[
'error-codes'
]?.[
0
]
||
'非法环境'
);
};
docSite/docs/flow-modules/examples/imgs/google_search_1.png
View file @
38e4a41c
368 KB
|
W:
|
H:
336 KB
|
W:
|
H:
2-up
Swipe
Onion skin
docSite/docs/flow-modules/examples/imgs/google_search_2.png
View file @
38e4a41c
271 KB
|
W:
|
H:
280 KB
|
W:
|
H:
2-up
Swipe
Onion skin
docSite/docs/flow-modules/examples/web_search_google.md
View file @
38e4a41c
This diff is collapsed.
Click to expand it.
docSite/i18n/zh-Hans/docusaurus-plugin-content-docs/current/flow-modules/examples/imgs/google_search_1.png
View file @
38e4a41c
368 KB
|
W:
|
H:
336 KB
|
W:
|
H:
2-up
Swipe
Onion skin
docSite/i18n/zh-Hans/docusaurus-plugin-content-docs/current/flow-modules/examples/imgs/google_search_2.png
View file @
38e4a41c
271 KB
|
W:
|
H:
280 KB
|
W:
|
H:
2-up
Swipe
Onion skin
docSite/i18n/zh-Hans/docusaurus-plugin-content-docs/current/flow-modules/examples/web_search_google.md
View file @
38e4a41c
This diff is collapsed.
Click to expand it.
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