Sfoglia il codice sorgente

:sparkles: ai settings

visuddhinanda 7 mesi fa
parent
commit
bf3b6880b5
1 ha cambiato i file con 13 aggiunte e 15 eliminazioni
  1. 13 15
      dashboard-v4/dashboard/src/load.ts

+ 13 - 15
dashboard-v4/dashboard/src/load.ts

@@ -22,9 +22,17 @@ import { IRelation, IRelationListResponse } from "./pages/admin/relation/list";
 import { pushRelation } from "./reducers/relation";
 import { IGroupMemberListResponse } from "./components/api/Group";
 import { IStudio } from "./components/auth/Studio";
+import { IAiModel } from "./components/api/ai";
 
+export interface ISettingModels {
+  wbw?: IAiModel[];
+  chat?: IAiModel[];
+}
 export interface ISiteInfoResponse {
+  logo: string;
   title: string;
+  subhead: string;
+  models?: ISettingModels;
 }
 interface IUserData {
   id: string;
@@ -73,22 +81,12 @@ export const grammarTermFetch = () => {
 };
 
 const init = () => {
-  get<ISiteInfoResponse | IErrorResponse>("/v2/site-info/en").then(
-    (response) => {
-      if ("title" in response) {
-        const it: ISite = {
-          title: response.title,
-          subhead: "",
-          keywords: [],
-          description: "",
-          copyright: "",
-          logo: "",
-          author: { name: "", email: "" },
-        };
-        store.dispatch(refreshLayout(it));
-      }
+  get<ISite | IErrorResponse>("/v2/site-info/en").then((response) => {
+    if ("title" in response) {
+      const it: ISite = response;
+      store.dispatch(refreshLayout(it));
     }
-  );
+  });
   //获取用户登录信息
   const token = getToken();
   if (token) {