mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-18 01:16:01 +00:00
fix: openapi key unsave
This commit is contained in:
@@ -14,7 +14,6 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
|
|||||||
const userId = await authToken(req);
|
const userId = await authToken(req);
|
||||||
|
|
||||||
await connectToDatabase();
|
await connectToDatabase();
|
||||||
|
|
||||||
// 更新对应的记录
|
// 更新对应的记录
|
||||||
await User.updateOne(
|
await User.updateOne(
|
||||||
{
|
{
|
||||||
@@ -22,7 +21,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
...(avatar && { avatar }),
|
...(avatar && { avatar }),
|
||||||
...(openaiKey && { openaiKey })
|
...(openaiKey !== undefined && { openaiKey })
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -61,6 +61,7 @@ const NumberSetting = () => {
|
|||||||
maxH: 60
|
maxH: 60
|
||||||
});
|
});
|
||||||
onclickSave({
|
onclickSave({
|
||||||
|
...userInfo,
|
||||||
avatar: base64
|
avatar: base64
|
||||||
});
|
});
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
@@ -70,7 +71,7 @@ const NumberSetting = () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[onclickSave, toast]
|
[onclickSave, toast, userInfo]
|
||||||
);
|
);
|
||||||
|
|
||||||
const onclickLogOut = useCallback(() => {
|
const onclickLogOut = useCallback(() => {
|
||||||
|
Reference in New Issue
Block a user