mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-11 20:43:42 +08:00
提供了accesstoken的登录方式
This commit is contained in:
@@ -114,35 +114,35 @@ export async function requestUsage() {
|
||||
requestOpenaiClient("dashboard/billing/subscription")(null, "GET"),
|
||||
]);
|
||||
|
||||
const response = (await used.json()) as {
|
||||
total_usage?: number;
|
||||
error?: {
|
||||
type: string;
|
||||
message: string;
|
||||
};
|
||||
};
|
||||
// const response = (await used.json()) as {
|
||||
// total_usage?: number;
|
||||
// error?: {
|
||||
// type: string;
|
||||
// message: string;
|
||||
// };
|
||||
// };
|
||||
|
||||
const total = (await subs.json()) as {
|
||||
hard_limit_usd?: number;
|
||||
};
|
||||
|
||||
if (response.error && response.error.type) {
|
||||
showToast(response.error.message);
|
||||
return;
|
||||
}
|
||||
// if (response.error && response.error.type) {
|
||||
// showToast(response.error.message);
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (response.total_usage) {
|
||||
response.total_usage = Math.round(response.total_usage) / 100;
|
||||
}
|
||||
// if (response.total_usage) {
|
||||
// response.total_usage = Math.round(response.total_usage) / 100;
|
||||
// }
|
||||
|
||||
if (total.hard_limit_usd) {
|
||||
total.hard_limit_usd = Math.round(total.hard_limit_usd * 100) / 100;
|
||||
}
|
||||
// if (total.hard_limit_usd) {
|
||||
// total.hard_limit_usd = Math.round(total.hard_limit_usd * 100) / 100;
|
||||
// }
|
||||
|
||||
return {
|
||||
used: response.total_usage,
|
||||
subscription: total.hard_limit_usd,
|
||||
};
|
||||
// return {
|
||||
// used: response.total_usage,
|
||||
// subscription: total.hard_limit_usd,
|
||||
// };
|
||||
}
|
||||
|
||||
export async function requestChatStream(
|
||||
|
Reference in New Issue
Block a user