diff --git a/CHANGELOG.md b/CHANGELOG.md index cdfced91..d4d6831a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ * 功能新增:新增GeeK易支付支付渠道,支持支付宝,微信支付,QQ钱包,京东支付,抖音支付,Paypal支付等支付方式 * Bug修复:修复注册页面 tab 组件没有自动选中问题 [#6](https://github.com/yangjian102621/geekai-plus/issues/6) * 功能优化:Luma生成视频任务增加自动翻译功能 +* Bug修复:Suno 和 Luma 任务没有判断用户算力 +* 功能新增:邮箱注册增加邮箱后缀白名单,防止使用某些垃圾邮箱注册薅羊毛 ## v4.1.3 * 功能优化:重构用户登录模块,给所有的登录组件增加行为验证码功能,支持用户绑定手机,邮箱和微信 diff --git a/api/core/types/config.go b/api/core/types/config.go index a396f9a1..b827d1f3 100644 --- a/api/core/types/config.go +++ b/api/core/types/config.go @@ -164,5 +164,6 @@ type SystemConfig struct { Copyright string `json:"copyright"` // 版权信息 MarkMapText string `json:"mark_map_text"` // 思维导入的默认文本 - EnabledVerify bool `json:"enabled_verify"` // 是否启用验证码 + EnabledVerify bool `json:"enabled_verify"` // 是否启用验证码 + EmailWhiteList []string `json:"email_white_list"` // 邮箱白名单列表 } diff --git a/api/handler/sms_handler.go b/api/handler/sms_handler.go index b64962c3..4f5bf344 100644 --- a/api/handler/sms_handler.go +++ b/api/handler/sms_handler.go @@ -76,6 +76,20 @@ func (h *SmsHandler) SendCode(c *gin.Context) { resp.ERROR(c, "系统已禁用邮箱注册!") return } + // 检查邮箱后缀是否在白名单 + if len(h.App.SysConfig.EmailWhiteList) > 0 { + inWhiteList := false + for _, suffix := range h.App.SysConfig.EmailWhiteList { + if strings.HasSuffix(data.Receiver, suffix) { + inWhiteList = true + break + } + } + if !inWhiteList { + resp.ERROR(c, "邮箱后缀不在白名单中") + return + } + } err = h.smtp.SendVerifyCode(data.Receiver, code) } else { if !utils.Contains(h.App.SysConfig.RegisterWays, "mobile") { diff --git a/web/src/components/ui/BlackInput.vue b/web/src/components/ui/BlackInput.vue index 1c3a495d..57acb553 100644 --- a/web/src/components/ui/BlackInput.vue +++ b/web/src/components/ui/BlackInput.vue @@ -47,6 +47,7 @@ watch(() => props.value, (newValue) => { model.value = newValue }) const model = ref(props.value) +// eslint-disable-next-line no-undef const emits = defineEmits(['update:value']); const onInput = (value) => { emits('update:value',value) diff --git a/web/src/components/ui/ItemsInput.vue b/web/src/components/ui/ItemsInput.vue new file mode 100644 index 00000000..42339645 --- /dev/null +++ b/web/src/components/ui/ItemsInput.vue @@ -0,0 +1,79 @@ + + + + \ No newline at end of file diff --git a/web/src/views/admin/SysConfig.vue b/web/src/views/admin/SysConfig.vue index a1f21979..7b6d3e3a 100644 --- a/web/src/views/admin/SysConfig.vue +++ b/web/src/views/admin/SysConfig.vue @@ -133,6 +133,10 @@ + + + +