mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-11 19:53:50 +08:00
支持微模型绑定 Dalle 绘图的 API KEY
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
- 功能优化:登录,注册页面允许替换用户自己的 Logo 和 Title
|
||||
- Bug 修复:修复 OpenAI 实时语音通话没有检测用户算力不足的 Bug
|
||||
- 功能新增:管理后台增加算力日志查询功能,支持按用户,按模型,按日期,按类型查询算力日志
|
||||
- 功能优化:支持为模型绑定 Dalle 和 chat 类型的 API KEY
|
||||
|
||||
## v4.1.8
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import (
|
||||
"geekai/store/vo"
|
||||
"geekai/utils"
|
||||
"geekai/utils/resp"
|
||||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"gorm.io/gorm"
|
||||
@@ -71,16 +72,18 @@ func (h *ApiKeyHandler) Save(c *gin.Context) {
|
||||
resp.SUCCESS(c, keyVo)
|
||||
}
|
||||
|
||||
// List 获取 API KEY 列表
|
||||
func (h *ApiKeyHandler) List(c *gin.Context) {
|
||||
status := h.GetBool(c, "status")
|
||||
t := h.GetTrim(c, "type")
|
||||
t := c.Query("type")
|
||||
|
||||
session := h.DB.Session(&gorm.Session{})
|
||||
if status {
|
||||
session = session.Where("enabled", true)
|
||||
}
|
||||
if t != "" {
|
||||
session = session.Where("type", t)
|
||||
types := strings.Split(t, "|")
|
||||
session = session.Where("type IN ?", types)
|
||||
}
|
||||
|
||||
var items []model.ApiKey
|
||||
|
||||
@@ -130,6 +130,7 @@
|
||||
<el-select v-model="item.key_id" placeholder="请选择 API KEY" filterable clearable>
|
||||
<el-option v-for="v in apiKeys" :value="v.id" :label="v.name" :key="v.id">
|
||||
{{ v.name }}
|
||||
<el-tag type="primary" size="small" class="ml-1 mr-1">{{ v.type }}</el-tag>
|
||||
<el-text type="info" size="small">{{ substr(v.api_url, 50) }}</el-text>
|
||||
</el-option>
|
||||
</el-select>
|
||||
@@ -194,7 +195,7 @@ const type = ref([
|
||||
|
||||
// 获取 API KEY
|
||||
const apiKeys = ref([]);
|
||||
httpGet("/api/admin/apikey/list?type=chat")
|
||||
httpGet("/api/admin/apikey/list?type=chat|dalle")
|
||||
.then((res) => {
|
||||
apiKeys.value = res.data;
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user