mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-12 04:53:44 +08:00
新增字节跳动ds模型兼容,新增华为ds模型兼容
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
XAI_BASE_URL,
|
||||
CHATGLM_BASE_URL,
|
||||
SILICONFLOW_BASE_URL,
|
||||
HUAWEI_BASE_URL,
|
||||
} from "../constant";
|
||||
import { getHeaders } from "../client/api";
|
||||
import { getClientConfig } from "../config/client";
|
||||
@@ -55,6 +56,8 @@ const DEFAULT_XAI_URL = isApp ? XAI_BASE_URL : ApiPath.XAI;
|
||||
|
||||
const DEFAULT_CHATGLM_URL = isApp ? CHATGLM_BASE_URL : ApiPath.ChatGLM;
|
||||
|
||||
const DEFAULT_HUAWEI_URL = isApp ? HUAWEI_BASE_URL : ApiPath.Huawei;
|
||||
|
||||
const DEFAULT_SILICONFLOW_URL = isApp
|
||||
? SILICONFLOW_BASE_URL
|
||||
: ApiPath.SiliconFlow;
|
||||
@@ -131,6 +134,9 @@ const DEFAULT_ACCESS_STATE = {
|
||||
// siliconflow
|
||||
siliconflowUrl: DEFAULT_SILICONFLOW_URL,
|
||||
siliconflowApiKey: "",
|
||||
// huawei
|
||||
huaweiUrl: DEFAULT_HUAWEI_URL,
|
||||
huaweiApiKey: "",
|
||||
|
||||
// server config
|
||||
needCode: true,
|
||||
@@ -219,6 +225,9 @@ export const useAccessStore = createPersistStore(
|
||||
return ensure(get(), ["siliconflowApiKey"]);
|
||||
},
|
||||
|
||||
isValidHuawei() {
|
||||
return ensure(get(), ["huaweiApiKey"]);
|
||||
},
|
||||
isAuthorized() {
|
||||
this.fetch();
|
||||
|
||||
@@ -238,6 +247,7 @@ export const useAccessStore = createPersistStore(
|
||||
this.isValidXAI() ||
|
||||
this.isValidChatGLM() ||
|
||||
this.isValidSiliconFlow() ||
|
||||
this.isValidHuawei() ||
|
||||
!this.enabledAccessControl() ||
|
||||
(this.enabledAccessControl() && ensure(get(), ["accessCode"]))
|
||||
);
|
||||
|
Reference in New Issue
Block a user