mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-02 20:58:12 +00:00
perf: 账号api结构
This commit is contained in:
@@ -12,7 +12,7 @@ import { pushGenerateVectorBill } from '../events/pushBill';
|
||||
export const getUserApiOpenai = async (userId: string) => {
|
||||
const user = await User.findById(userId);
|
||||
|
||||
const userApiKey = user?.accounts?.find((item: any) => item.type === 'openai')?.value;
|
||||
const userApiKey = user?.openaiKey;
|
||||
|
||||
if (!userApiKey) {
|
||||
return Promise.reject('缺少ApiKey, 无法请求');
|
||||
@@ -35,7 +35,7 @@ export const getOpenApiKey = async (userId: string) => {
|
||||
});
|
||||
}
|
||||
|
||||
const userApiKey = user?.accounts?.find((item: any) => item.type === 'openai')?.value;
|
||||
const userApiKey = user?.openaiKey;
|
||||
|
||||
// 有自己的key
|
||||
if (userApiKey) {
|
||||
|
Reference in New Issue
Block a user