wip: tencent

This commit is contained in:
Dogtiti
2024-07-07 14:43:28 +08:00
parent 7218f13783
commit d726c71141
8 changed files with 721 additions and 71 deletions

View File

@@ -47,6 +47,11 @@ const DEFAULT_ACCESS_STATE = {
anthropicApiVersion: "2023-06-01",
anthropicUrl: "",
// tencent
tencentUrl: "",
tencentSecretKey: "",
tencentSecretId: "",
// server config
needCode: true,
hideUserApiKey: false,
@@ -83,6 +88,10 @@ export const useAccessStore = createPersistStore(
return ensure(get(), ["anthropicApiKey"]);
},
isValidTencent() {
return ensure(get(), ["tencentSecretKey", "tencentSecretId"]);
},
isAuthorized() {
this.fetch();
@@ -92,6 +101,7 @@ export const useAccessStore = createPersistStore(
this.isValidAzure() ||
this.isValidGoogle() ||
this.isValidAnthropic() ||
this.isValidTencent ||
!this.enabledAccessControl() ||
(this.enabledAccessControl() && ensure(get(), ["accessCode"]))
);