fix: 多语言字典数据源同步更新
This commit is contained in:
@@ -140,8 +140,8 @@ func (s *SysDictDataController) Edit(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 检查字典编码是否存在
|
||||
SysDictDataController := s.sysDictDataService.SelectDictDataByCode(body.DictCode)
|
||||
if SysDictDataController.DictCode != body.DictCode {
|
||||
sysDictData := s.sysDictDataService.SelectDictDataByCode(body.DictCode)
|
||||
if sysDictData.DictCode != body.DictCode {
|
||||
// 没有可访问字典编码数据!
|
||||
c.JSON(200, result.ErrMsg(i18n.TKey(language, "dictData.noData")))
|
||||
return
|
||||
@@ -156,6 +156,19 @@ func (s *SysDictDataController) Edit(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
// 多语言非原始值
|
||||
i18nValue := i18n.TKey(language, sysDictData.DictLabel)
|
||||
if i18nValue != sysDictData.DictLabel {
|
||||
i18n.UpdateKeyValue(language, sysDictData.DictLabel, body.DictLabel)
|
||||
body.DictLabel = sysDictData.DictLabel
|
||||
}
|
||||
// 多语言非原始值
|
||||
i18nValue2 := i18n.TKey(language, sysDictData.Remark)
|
||||
if i18nValue2 != sysDictData.Remark {
|
||||
i18n.UpdateKeyValue(language, sysDictData.Remark, body.Remark)
|
||||
body.Remark = sysDictData.Remark
|
||||
}
|
||||
|
||||
body.UpdateBy = ctx.LoginUserToUserName(c)
|
||||
rows := s.sysDictDataService.UpdateDictData(body)
|
||||
if rows > 0 {
|
||||
|
||||
Reference in New Issue
Block a user