mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 19:52:27 +08:00
add moonshot api
This commit is contained in:
@@ -39,6 +39,10 @@ const DEFAULT_ALIBABA_URL = isApp
|
||||
? DEFAULT_API_HOST + "/api/proxy/alibaba"
|
||||
: ApiPath.Alibaba;
|
||||
|
||||
const DEFAULT_MOONSHOT_URL = isApp
|
||||
? DEFAULT_API_HOST + "/api/proxy/moonshot"
|
||||
: ApiPath.Moonshot;
|
||||
|
||||
const DEFAULT_STABILITY_URL = isApp
|
||||
? DEFAULT_API_HOST + "/api/proxy/stability"
|
||||
: ApiPath.Stability;
|
||||
@@ -82,6 +86,10 @@ const DEFAULT_ACCESS_STATE = {
|
||||
alibabaUrl: DEFAULT_ALIBABA_URL,
|
||||
alibabaApiKey: "",
|
||||
|
||||
// moonshot
|
||||
moonshotUrl: DEFAULT_MOONSHOT_URL,
|
||||
moonshotApiKey: "",
|
||||
|
||||
//stability
|
||||
stabilityUrl: DEFAULT_STABILITY_URL,
|
||||
stabilityApiKey: "",
|
||||
@@ -134,6 +142,10 @@ export const useAccessStore = createPersistStore(
|
||||
return ensure(get(), ["alibabaApiKey"]);
|
||||
},
|
||||
|
||||
isValidMoonshot() {
|
||||
return ensure(get(), ["moonshotApiKey"]);
|
||||
},
|
||||
|
||||
isAuthorized() {
|
||||
this.fetch();
|
||||
|
||||
@@ -146,6 +158,7 @@ export const useAccessStore = createPersistStore(
|
||||
this.isValidBaidu() ||
|
||||
this.isValidByteDance() ||
|
||||
this.isValidAlibaba() ||
|
||||
this.isValidMoonshot() ||
|
||||
!this.enabledAccessControl() ||
|
||||
(this.enabledAccessControl() && ensure(get(), ["accessCode"]))
|
||||
);
|
||||
|
Reference in New Issue
Block a user