File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
src/pages/BuildPage/tools/builtInTool Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " bisheng" ,
3
- "version" : " 2.0.0 " ,
3
+ "version" : " 2.0.3 " ,
4
4
"private" : true ,
5
5
"dependencies" : {
6
6
"@headlessui/react" : " ^2.0.4" ,
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ const temp = {
18
18
19
19
const Dalle3ToolForm = ( { formData, onSubmit } ) => {
20
20
const { t } = useTranslation ( ) ;
21
-
21
+ const [ pro , setPro ] = useState ( '' )
22
22
const [ localFormData , setLocalFormData ] = useState ( ( ) => {
23
23
if ( ! formData || Object . keys ( formData ) . length === 0 ) {
24
24
return { ...temp } ;
@@ -31,6 +31,7 @@ const Dalle3ToolForm = ({ formData, onSubmit }) => {
31
31
// 根据provider类型决定显示哪个API Key
32
32
let displayApiKey = '' ;
33
33
console . log ( provider , 222 ) ;
34
+ setPro ( provider )
34
35
35
36
if ( provider === 'openai' ) {
36
37
displayApiKey = formData . openai_api_key || '' ;
@@ -56,6 +57,13 @@ const Dalle3ToolForm = ({ formData, onSubmit }) => {
56
57
} ;
57
58
58
59
const handleProviderChange = ( value ) => {
60
+ console . log ( value , pro , formData . openai_api_key ) ;
61
+
62
+ if ( value !== pro ) {
63
+ localFormData . openai_api_key = ''
64
+ } else {
65
+ localFormData . openai_api_key = formData . openai_api_key
66
+ }
59
67
setLocalFormData ( ( prev ) => ( { ...prev , provider : value } ) ) ;
60
68
} ;
61
69
You can’t perform that action at this time.
0 commit comments