merge main

This commit is contained in:
lloydzhou
2024-07-09 16:53:15 +08:00
17 changed files with 708 additions and 8 deletions

View File

@@ -47,6 +47,11 @@ const DEFAULT_ACCESS_STATE = {
anthropicApiVersion: "2023-06-01",
anthropicUrl: "",
// baidu
baiduUrl: "",
baiduApiKey: "",
baiduSecretKey: "",
// bytedance
bytedanceApiKey: "",
bytedanceUrl: "",
@@ -87,6 +92,10 @@ export const useAccessStore = createPersistStore(
return ensure(get(), ["anthropicApiKey"]);
},
isValidBaidu() {
return ensure(get(), ["baiduApiKey", "baiduSecretKey"]);
},
isValidByteDance() {
return ensure(get(), ["bytedanceApiKey"]);
},
@@ -100,6 +109,7 @@ export const useAccessStore = createPersistStore(
this.isValidAzure() ||
this.isValidGoogle() ||
this.isValidAnthropic() ||
this.isValidBaidu() ||
this.isValidByteDance() ||
!this.enabledAccessControl() ||
(this.enabledAccessControl() && ensure(get(), ["accessCode"]))