mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-16 22:13:47 +08:00
Merge remote-tracking branch 'upstream/main' into dev
# Conflicts: # app/components/settings.tsx # app/config/server.ts # app/constant.ts # package.json # yarn.lock
This commit is contained in:
@@ -39,6 +39,10 @@ const DEFAULT_ALIBABA_URL = isApp
|
||||
? DEFAULT_API_HOST + "/api/proxy/alibaba"
|
||||
: ApiPath.Alibaba;
|
||||
|
||||
const DEFAULT_TENCENT_URL = isApp
|
||||
? DEFAULT_API_HOST + "/api/proxy/tencent"
|
||||
: ApiPath.Tencent;
|
||||
|
||||
const DEFAULT_MOONSHOT_URL = isApp
|
||||
? DEFAULT_API_HOST + "/api/proxy/moonshot"
|
||||
: ApiPath.Moonshot;
|
||||
@@ -95,6 +99,11 @@ const DEFAULT_ACCESS_STATE = {
|
||||
stabilityUrl: DEFAULT_STABILITY_URL,
|
||||
stabilityApiKey: "",
|
||||
|
||||
// tencent
|
||||
tencentUrl: DEFAULT_TENCENT_URL,
|
||||
tencentSecretKey: "",
|
||||
tencentSecretId: "",
|
||||
|
||||
// server config
|
||||
needCode: true,
|
||||
hideUserApiKey: false,
|
||||
@@ -146,6 +155,10 @@ export const useAccessStore = createPersistStore(
|
||||
return ensure(get(), ["alibabaApiKey"]);
|
||||
},
|
||||
|
||||
isValidTencent() {
|
||||
return ensure(get(), ["tencentSecretKey", "tencentSecretId"]);
|
||||
},
|
||||
|
||||
isValidMoonshot() {
|
||||
return ensure(get(), ["moonshotApiKey"]);
|
||||
},
|
||||
@@ -162,6 +175,7 @@ export const useAccessStore = createPersistStore(
|
||||
this.isValidBaidu() ||
|
||||
this.isValidByteDance() ||
|
||||
this.isValidAlibaba() ||
|
||||
this.isValidTencent ||
|
||||
this.isValidMoonshot() ||
|
||||
!this.enabledAccessControl() ||
|
||||
(this.enabledAccessControl() && ensure(get(), ["accessCode"]))
|
||||
|
||||
Reference in New Issue
Block a user