增加ai配置和ai广场功能
This commit is contained in:
1 parent
244b4bd9fd
commit
d9a50e23dd
27 files changed
+3808
-57
No files matched your search
@@ -110,9 +110,14 @@ func (c *PlatformWebsiteSettingController) Save() {
|
||||
_ = c.ServeJSON()
|
||||
}
|
||||
|
||||
// loginBrandTags 登录页品牌配置项,存放于 yz_platform_site_setting,
|
||||
// loginBrandTags 登录页品牌/登录方式配置项,存放于 yz_platform_site_setting,
|
||||
// 统一认证中心 /auth/login 渲染时读取。
|
||||
var loginBrandTags = []string{"login_title", "login_subtitle", "login_logo", "login_bg"}
|
||||
// login_pwd_enabled / login_sms_enabled / login_qr_enabled:
|
||||
// 值为 "0" 表示关闭该登录方式,未配置(空)默认开启;三者全关时登录页禁止登录。
|
||||
var loginBrandTags = []string{
|
||||
"login_title", "login_subtitle", "login_logo", "login_bg",
|
||||
"login_pwd_enabled", "login_sms_enabled", "login_qr_enabled",
|
||||
}
|
||||
|
||||
// LoginBrandInfo GET /platform/loginBrand
|
||||
// 返回登录页品牌配置(主标题 / 副标题 / Logo / 背景图)。
|
||||
@@ -172,8 +177,13 @@ func (c *PlatformWebsiteSettingController) SaveLoginBrand() {
|
||||
c.jsonErr(400, 400, "副标题不能超过 120 个字符")
|
||||
return
|
||||
}
|
||||
// 只校验本次提交了的图片字段,避免「登录方式」等只传开关的保存把品牌图清空
|
||||
for _, tag := range []string{"login_logo", "login_bg"} {
|
||||
img, ok := normalizeLoginBrandImage(values[tag])
|
||||
raw, submitted := payload[tag]
|
||||
if !submitted {
|
||||
continue
|
||||
}
|
||||
img, ok := normalizeLoginBrandImage(raw)
|
||||
if !ok {
|
||||
c.jsonErr(400, 400, "图片地址必须是 HTTPS 或站内相对路径")
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user