fix: 配置参数多语言源数据变更
This commit is contained in:
@@ -128,13 +128,32 @@ func (s *SysConfigController) Edit(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 检查是否存在
|
||||
config := s.sysConfigService.SelectConfigById(body.ConfigID)
|
||||
if config.ConfigID != body.ConfigID {
|
||||
configInfo := s.sysConfigService.SelectConfigById(body.ConfigID)
|
||||
if configInfo.ConfigID != body.ConfigID {
|
||||
// 没有可访问参数配置数据!
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "config.noData")))
|
||||
return
|
||||
}
|
||||
|
||||
// 多语言非原始值
|
||||
i18nValue := i18n.TKey(language, configInfo.ConfigName)
|
||||
if i18nValue != configInfo.ConfigName {
|
||||
i18n.UpdateKeyValue(language, configInfo.ConfigName, body.ConfigName)
|
||||
body.ConfigName = configInfo.ConfigName
|
||||
}
|
||||
// 多语言非原始值
|
||||
i18nValue2 := i18n.TKey(language, configInfo.ConfigValue)
|
||||
if i18nValue2 != configInfo.ConfigValue {
|
||||
i18n.UpdateKeyValue(language, configInfo.ConfigValue, body.ConfigValue)
|
||||
body.ConfigValue = configInfo.ConfigValue
|
||||
}
|
||||
// 多语言非原始值
|
||||
i18nValue3 := i18n.TKey(language, configInfo.Remark)
|
||||
if i18nValue3 != configInfo.Remark {
|
||||
i18n.UpdateKeyValue(language, configInfo.Remark, body.Remark)
|
||||
body.Remark = configInfo.Remark
|
||||
}
|
||||
|
||||
body.UpdateBy = ctx.LoginUserToUserName(c)
|
||||
rows := s.sysConfigService.UpdateConfig(body)
|
||||
if rows > 0 {
|
||||
|
||||
Reference in New Issue
Block a user