chatGPT部分完成

This commit is contained in:
aixianling
2023-05-15 17:58:00 +08:00
parent b773d87ff3
commit 8e894760a7
3 changed files with 18 additions and 11 deletions

View File

@@ -55,7 +55,7 @@ export class ChatGPT extends BaseModel {
if (endDate) {
const startDate = new Date(endDate - 90 * 24 * 60 * 60);
const formattedDate = time => dayjs(time).format("YYYY-MM-DD")
return axios.get(`${ChatGPT.base}/v1/dashboard/billing/usage?start_date=${formattedDate(startDate * 1000)}&end_date=${formattedDate(endDate * 1000)}`,
return await axios.get(`${ChatGPT.base}/v1/dashboard/billing/usage?start_date=${formattedDate(startDate * 1000)}&end_date=${formattedDate(endDate * 1000)}`,
{headers}).then(res => res.json()).then(res => {
usages.total_usage = res.total_usage
const names = usages.account_name.split(" ")