mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-06-16 21:03:58 +08:00
refactor(quotaConfigs.ts): make Chatgpt-Account-Id header optional to handle missing account IDs gracefully
This commit is contained in:
@@ -410,14 +410,13 @@ const fetchCodexQuota = async (
|
||||
|
||||
const planTypeFromFile = resolveCodexPlanType(file);
|
||||
const accountId = resolveCodexChatgptAccountId(file);
|
||||
if (!accountId) {
|
||||
throw new Error(t('codex_quota.missing_account_id'));
|
||||
}
|
||||
|
||||
const requestHeader: Record<string, string> = {
|
||||
...CODEX_REQUEST_HEADERS,
|
||||
'Chatgpt-Account-Id': accountId,
|
||||
};
|
||||
if (accountId) {
|
||||
requestHeader['Chatgpt-Account-Id'] = accountId;
|
||||
}
|
||||
|
||||
const result = await apiCallApi.request({
|
||||
authIndex,
|
||||
|
||||
Reference in New Issue
Block a user