fix: default model

This commit is contained in:
Dogtiti 2024-09-27 17:00:24 +08:00
parent 870ad913cc
commit c6ebd6e73c
1 changed files with 7 additions and 4 deletions

View File

@ -211,10 +211,13 @@ export const useAccessStore = createPersistStore(
}) })
.then((res) => res.json()) .then((res) => res.json())
.then((res) => { .then((res) => {
// Set default model from env request const defaultModel = res.defaultModel ?? "";
let defaultModel = res.defaultModel ?? ""; if (defaultModel !== "") {
if (defaultModel !== "") const [model, providerName] = defaultModel.split("@");
DEFAULT_CONFIG.modelConfig.model = defaultModel; DEFAULT_CONFIG.modelConfig.model = model;
DEFAULT_CONFIG.modelConfig.providerName = providerName;
}
return res; return res;
}) })
.then((res: DangerConfig) => { .then((res: DangerConfig) => {