mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 16:56:38 +08:00
opt: optimize the layout for regiseter page. add function to disable registration
This commit is contained in:
parent
d7bbfb0fc3
commit
e04856f794
11
CHANGELOG.md
11
CHANGELOG.md
@ -1,5 +1,16 @@
|
|||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
## v3.0.6
|
||||||
|
1. 管理后台:新增用户名和手机号码搜索功能
|
||||||
|
2. 管理后台:新增重置用户密码功能
|
||||||
|
3. 管理后台:支持关闭注册功能,新增添加用户功能,适用于内部使用场景
|
||||||
|
4. 管理后台:新增仪表盘页面,统计当天的新增用户,新增会话数据,以及 Token 消耗
|
||||||
|
5. Bug修复:修复注册页面验证码不显示 Bug
|
||||||
|
6. Bug修复:优化上下文 Token 计算算法,修复聊天上下文超出限制时循环发送消息的 Bug
|
||||||
|
7. 功能修正:允许用户使用手机号码登录
|
||||||
|
8. 功能优化:更新系统配置后同步更新服务端内存变量数据
|
||||||
|
9. 功能优化:优化打包脚本,减少容器镜像大小
|
||||||
|
|
||||||
## v3.0.5
|
## v3.0.5
|
||||||
|
|
||||||
重磅功能更新!!! 新增函数插件支持,可以轻松地接入你的第三方插件服务,ChatGPT 自动帮您调用对应的函数完成任务。
|
重磅功能更新!!! 新增函数插件支持,可以轻松地接入你的第三方插件服务,ChatGPT 自动帮您调用对应的函数完成任务。
|
||||||
|
@ -89,6 +89,5 @@ type SystemConfig struct {
|
|||||||
AdminTitle string `json:"admin_title"`
|
AdminTitle string `json:"admin_title"`
|
||||||
Models []string `json:"models"`
|
Models []string `json:"models"`
|
||||||
UserInitCalls int `json:"user_init_calls"` // 新用户注册默认总送多少次调用
|
UserInitCalls int `json:"user_init_calls"` // 新用户注册默认总送多少次调用
|
||||||
|
EnabledRegister bool `json:"enabled_register"`
|
||||||
}
|
}
|
||||||
|
|
||||||
const UserInitCalls = 20
|
|
||||||
|
@ -52,12 +52,17 @@ func (h *ConfigHandler) Update(c *gin.Context) {
|
|||||||
// update config cache for AppServer
|
// update config cache for AppServer
|
||||||
var cfg model.Config
|
var cfg model.Config
|
||||||
h.db.Where("marker", data.Key).First(&cfg)
|
h.db.Where("marker", data.Key).First(&cfg)
|
||||||
err := utils.JsonDecode(cfg.Config, &h.App.ChatConfig)
|
var err error
|
||||||
|
if data.Key == "system" {
|
||||||
|
err = utils.JsonDecode(cfg.Config, &h.App.SysConfig)
|
||||||
|
} else if data.Key == "chat" {
|
||||||
|
err = utils.JsonDecode(cfg.Config, &h.App.ChatConfig)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
resp.ERROR(c, "Failed to update config cache: "+err.Error())
|
resp.ERROR(c, "Failed to update config cache: "+err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
logger.Debugf("Update AppServer's config successfully: %v", config.Config)
|
logger.Infof("Update AppServer's config successfully: %v", config.Config)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp.SUCCESS(c, config)
|
resp.SUCCESS(c, config)
|
||||||
|
@ -59,7 +59,12 @@ func (h *SmsHandler) SendCode(c *gin.Context) {
|
|||||||
resp.SUCCESS(c)
|
resp.SUCCESS(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type statusVo struct {
|
||||||
|
EnabledMsgService bool `json:"enabled_msg_service"`
|
||||||
|
EnabledRegister bool `json:"enabled_register"`
|
||||||
|
}
|
||||||
|
|
||||||
// Status check if the message service is enabled
|
// Status check if the message service is enabled
|
||||||
func (h *SmsHandler) Status(c *gin.Context) {
|
func (h *SmsHandler) Status(c *gin.Context) {
|
||||||
resp.SUCCESS(c, h.App.Config.EnabledMsgService)
|
resp.SUCCESS(c, statusVo{EnabledMsgService: h.App.Config.EnabledMsgService, EnabledRegister: h.App.SysConfig.EnabledRegister})
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="bg"></div>
|
<div class="bg"></div>
|
||||||
<div class="main">
|
<div class="register-page">
|
||||||
<div class="contain">
|
<div class="page-inner">
|
||||||
|
<div class="contain" v-if="enableRegister">
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<el-image src="images/logo.png" fit="cover"/>
|
<el-image src="images/logo.png" fit="cover"/>
|
||||||
</div>
|
</div>
|
||||||
@ -93,11 +94,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="tip-result" v-else>
|
||||||
|
<el-result icon="error" title="注册功能已关闭">
|
||||||
|
<template #sub-title>
|
||||||
|
<p>抱歉,系统已关闭注册功能,请联系管理员添加账号!</p>
|
||||||
|
</template>
|
||||||
|
</el-result>
|
||||||
|
</div>
|
||||||
|
|
||||||
<footer class="footer">
|
<footer class="footer">
|
||||||
<footer-bar/>
|
<footer-bar/>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -121,10 +131,12 @@ const formData = ref({
|
|||||||
})
|
})
|
||||||
const formRef = ref(null)
|
const formRef = ref(null)
|
||||||
const enableMsg = ref(false)
|
const enableMsg = ref(false)
|
||||||
|
const enableRegister = ref(true)
|
||||||
|
|
||||||
httpGet('/api/sms/status').then(res => {
|
httpGet('/api/sms/status').then(res => {
|
||||||
if (res.data === true) {
|
if (res.data) {
|
||||||
enableMsg.value = true
|
enableMsg.value = res.data['enabled_msg_service']
|
||||||
|
enableRegister.value = res.data['enabled_register']
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -166,18 +178,23 @@ const register = function () {
|
|||||||
//filter: blur(10px); /* 调整模糊程度,可以根据需要修改值 */
|
//filter: blur(10px); /* 调整模糊程度,可以根据需要修改值 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.main {
|
.register-page {
|
||||||
|
display flex
|
||||||
|
justify-content center
|
||||||
|
|
||||||
|
.page-inner {
|
||||||
|
max-width 450px
|
||||||
|
height 100vh
|
||||||
|
display flex
|
||||||
|
justify-content center
|
||||||
|
align-items center
|
||||||
|
|
||||||
.contain {
|
.contain {
|
||||||
position fixed
|
padding 0 40px 20px 40px;
|
||||||
left 50%
|
|
||||||
top 40%
|
|
||||||
width 90%
|
|
||||||
max-width 400px
|
|
||||||
transform translate(-50%, -50%)
|
|
||||||
padding 20px 40px;
|
|
||||||
color #ffffff
|
color #ffffff
|
||||||
border-radius 10px;
|
border-radius 10px;
|
||||||
background rgba(255, 255, 255, 0.3)
|
z-index 10
|
||||||
|
background-color rgba(255, 255, 255, 0.3)
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
text-align center
|
text-align center
|
||||||
@ -231,6 +248,11 @@ const register = function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.tip-result {
|
||||||
|
z-index 10
|
||||||
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
color #ffffff;
|
color #ffffff;
|
||||||
|
|
||||||
@ -238,5 +260,27 @@ const register = function () {
|
|||||||
padding 20px;
|
padding 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style lang="stylus">
|
||||||
|
.register-page {
|
||||||
|
.el-result {
|
||||||
|
|
||||||
|
border-radius 10px;
|
||||||
|
background-color rgba(14, 25, 30, 0.6)
|
||||||
|
border 1px solid #666
|
||||||
|
|
||||||
|
.el-result__title p {
|
||||||
|
color #ffffff
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-result__subtitle p {
|
||||||
|
color #c1c1c1
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -12,6 +12,9 @@
|
|||||||
<el-form-item label="注册赠送次数" prop="init_calls">
|
<el-form-item label="注册赠送次数" prop="init_calls">
|
||||||
<el-input v-model.number="system['user_init_calls']" placeholder="新用户注册赠送对话次数"/>
|
<el-input v-model.number="system['user_init_calls']" placeholder="新用户注册赠送对话次数"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="开放用户注册" prop="init_calls">
|
||||||
|
<el-switch v-model="system['enabled_register']"/>
|
||||||
|
</el-form-item>
|
||||||
<el-alert type="info" show-icon :closable="false">
|
<el-alert type="info" show-icon :closable="false">
|
||||||
<p>在这里维护前端聊天页面可用的 GPT 模型列表</p>
|
<p>在这里维护前端聊天页面可用的 GPT 模型列表</p>
|
||||||
</el-alert>
|
</el-alert>
|
||||||
|
Loading…
Reference in New Issue
Block a user