Skip to content

Commit

Permalink
fix: Fix Path Error
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed Feb 24, 2024
1 parent 07ff347 commit cc4ba78
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/services/translate/openai/index.jsx
Expand Up @@ -17,7 +17,7 @@ export async function translate(text, from, to, options = {}) {
if (requestPath.endsWith('/')) {
requestPath = requestPath.slice(0, -1);
}
if (service === 'openai' && !requestPath.endsWith('/v1/chat/completions')) {
if (service === 'openai' && !requestPath.includes('/v1/chat/completions')) {
requestPath += '/v1/chat/completions';
}

Expand Down
2 changes: 1 addition & 1 deletion src/services/translate/openai_custom/index.jsx
Expand Up @@ -17,7 +17,7 @@ export async function translate(text, from, to, options = {}) {
if (requestPath.endsWith('/')) {
requestPath = requestPath.slice(0, -1);
}
if (service === 'openai' && !requestPath.endsWith('/v1/chat/completions')) {
if (service === 'openai' && !requestPath.includes('/v1/chat/completions')) {
requestPath += '/v1/chat/completions';
}
// 兼容旧版
Expand Down
2 changes: 1 addition & 1 deletion src/services/translate/openai_polish/index.jsx
Expand Up @@ -17,7 +17,7 @@ export async function translate(text, from, to, options = {}) {
if (requestPath.endsWith('/')) {
requestPath = requestPath.slice(0, -1);
}
if (service === 'openai' && !requestPath.endsWith('/v1/chat/completions')) {
if (service === 'openai' && !requestPath.includes('/v1/chat/completions')) {
requestPath += '/v1/chat/completions';
}
// 兼容旧版
Expand Down
2 changes: 1 addition & 1 deletion src/services/translate/openai_summary/index.jsx
Expand Up @@ -17,7 +17,7 @@ export async function translate(text, from, to, options = {}) {
if (requestPath.endsWith('/')) {
requestPath = requestPath.slice(0, -1);
}
if (service === 'openai' && !requestPath.endsWith('/v1/chat/completions')) {
if (service === 'openai' && !requestPath.includes('/v1/chat/completions')) {
requestPath += '/v1/chat/completions';
}
// 兼容旧版
Expand Down

0 comments on commit cc4ba78

Please sign in to comment.