diff --git a/api/core/types/config.go b/api/core/types/config.go index 355b08e..b0ec7eb 100644 --- a/api/core/types/config.go +++ b/api/core/types/config.go @@ -175,4 +175,6 @@ type SystemConfig struct { EnableContext bool `json:"enable_context,omitempty"` ContextDeep int `json:"context_deep,omitempty"` + + SdNegPrompt string `json:"sd_neg_prompt"` // SD 默认反向提示词 } diff --git a/api/handler/chatimpl/xunfei_handler.go b/api/handler/chatimpl/xunfei_handler.go index ee0c782..bbe668e 100644 --- a/api/handler/chatimpl/xunfei_handler.go +++ b/api/handler/chatimpl/xunfei_handler.go @@ -83,7 +83,7 @@ func (h *ChatHandler) sendXunFeiMessage( res = h.DB.Where("id", session.Model.KeyId).Where("enabled", true).Find(&apiKey) } // use the last unused key - if res.Error != nil { + if apiKey.Id == 0 { res = h.DB.Where("platform", session.Model.Platform).Where("type", "chat").Where("enabled", true).Order("last_used_at ASC").First(&apiKey) } if res.Error != nil { diff --git a/api/service/license_service.go b/api/service/license_service.go index d31eaaf..8f04ac9 100644 --- a/api/service/license_service.go +++ b/api/service/license_service.go @@ -47,9 +47,9 @@ func NewLicenseService(server *core.AppServer, levelDB *store.LevelDB) *LicenseS type License struct { Name string `json:"name"` - License string `json:"license"` - Mid string `json:"mid"` - ActiveAt int64 `json:"active_at"` + License string `json:"license"` + MachineId string `json:"mid"` + ActiveAt int64 `json:"active_at"` ExpiredAt int64 `json:"expired_at"` UserNum int `json:"user_num"` } @@ -139,7 +139,7 @@ func (s *LicenseService) fetchLicense() (*types.License, error) { return &types.License{ Key: res.Data.License, - MachineId: res.Data.Mid, + MachineId: res.Data.MachineId, UserNum: res.Data.UserNum, ExpiredAt: res.Data.ExpiredAt, IsActive: true, diff --git a/api/service/mj/pool.go b/api/service/mj/pool.go index 993d5c3..1a2dd79 100644 --- a/api/service/mj/pool.go +++ b/api/service/mj/pool.go @@ -58,6 +58,7 @@ func NewServicePool(db *gorm.DB, redisCli *redis.Client, manager *oss.UploaderMa services = append(services, plusService) } + // for mid-journey proxy for k, config := range appConfig.MjProxyConfigs { if config.Enabled == false { continue diff --git a/web/src/views/ImageSd.vue b/web/src/views/ImageSd.vue index 4436ff0..2f731ba 100644 --- a/web/src/views/ImageSd.vue +++ b/web/src/views/ImageSd.vue @@ -608,7 +608,8 @@ onMounted(() => { }) httpGet("/api/config/get?key=system").then(res => { - sdPower.value = res.data["sd_power"] + sdPower.value = res.data.sd_power + params.value.neg_prompt = res.data.sd_neg_prompt }).catch(e => { ElMessage.error("获取系统配置失败:" + e.message) }) diff --git a/web/src/views/admin/ChatModel.vue b/web/src/views/admin/ChatModel.vue index 81833bf..a82b653 100644 --- a/web/src/views/admin/ChatModel.vue +++ b/web/src/views/admin/ChatModel.vue @@ -296,7 +296,7 @@ onUnmounted(() => { const add = function () { title.value = "新增模型" showDialog.value = true - item.value = {enabled: true, weight: 1} + item.value = {enabled: true, weight: 1, open: true} } const edit = function (row) { diff --git a/web/src/views/admin/SysConfig.vue b/web/src/views/admin/SysConfig.vue index ebf1e15..de4c7a6 100644 --- a/web/src/views/admin/SysConfig.vue +++ b/web/src/views/admin/SysConfig.vue @@ -1,56 +1,40 @@