Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于【余额】检测由于vercel缓存导致不会刷新的问题解决办法 #277

Closed
JeazW opened this issue Mar 31, 2023 · 0 comments

Comments

@JeazW
Copy link

JeazW commented Mar 31, 2023

image

做以下改动修复了(我不会写代码,当然是chatgpt给的解决办法哈哈)

export async function requestUsage() {
  const id = Date.now().toString(); // 生成随机数

  const res = await requestOpenaiClient(`dashboard/billing/credit_grants?id=${id}`)(
    null,
    "GET",
  );

  try {
    const response = (await res.json()) as {
      total_available: number;
      total_granted: number;
      total_used: number;
    };
    return response;
  } catch (error) {
    console.error("[Request usage] ", error, res.body);
  }
}

原方法

export async function requestUsage() {
  const res = await requestOpenaiClient("dashboard/billing/credit_grants")(
    null,
    "GET",
  );

  try {
    const response = (await res.json()) as {
      total_available: number;
      total_granted: number;
      total_used: number;
    };
    return response;
  } catch (error) {
    console.error("[Request usage] ", error, res.body);
  }
}
Yidadaa added a commit that referenced this issue Mar 31, 2023
yxl pushed a commit to yxl/ChatGPT-Next-Web that referenced this issue May 4, 2023
yxl pushed a commit to yxl/ChatGPT-Next-Web that referenced this issue May 4, 2023
ryiann pushed a commit to ryiann/ChatGPT that referenced this issue Feb 19, 2024
* Feat [UI/UX] [Locales] ShowFullChatHistory

- [+] feat(locales): add ShowFullChatHistory translations for cn, en, and id locales

* Refactor [UI/UX] [Front End] [Chats] Update Locales

- [+] refactor(chat.tsx): update Locale.Mask.Config.HideContext to Locale.Mask.Config.ShowFullChatHistory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant