Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
9118b043
提交
9118b043
authored
5月 10, 2022
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 国际化
上级
5d674fcc
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
20 行增加
和
8 行删除
+20
-8
SysUserController.java
...in/java/io/dataease/controller/sys/SysUserController.java
+6
-4
messages_en_US.properties
backend/src/main/resources/i18n/messages_en_US.properties
+5
-2
messages_zh_CN.properties
backend/src/main/resources/i18n/messages_zh_CN.properties
+4
-0
messages_zh_TW.properties
backend/src/main/resources/i18n/messages_zh_TW.properties
+5
-2
没有找到文件。
backend/src/main/java/io/dataease/controller/sys/SysUserController.java
浏览文件 @
9118b043
...
...
@@ -4,6 +4,8 @@ import com.github.pagehelper.Page;
import
com.github.pagehelper.PageHelper
;
import
com.github.xiaoymin.knife4j.annotations.ApiSupport
;
import
io.dataease.auth.api.dto.CurrentUserDto
;
import
io.dataease.exception.DataEaseException
;
import
io.dataease.i18n.Translator
;
import
io.dataease.plugins.common.base.domain.SysRole
;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.commons.utils.PageUtils
;
...
...
@@ -122,17 +124,17 @@ public class SysUserController {
Long
userId
=
AuthUtils
.
getUser
().
getUserId
();
// 防止修改他人信息, 防止必填内容留空
if
(!
request
.
getUserId
().
equals
(
userId
)
||
request
.
getEmail
()
==
null
||
request
.
getNickName
()
==
null
)
{
throw
new
RuntimeException
(
"内容不合法"
);
DataEaseException
.
throwException
(
Translator
.
get
(
"i18n_wrong_content"
)
);
}
// 再次验证,匹配格式
if
(!
request
.
getPhone
().
isEmpty
()
&&
!
request
.
getPhone
().
matches
(
"^1[3|4|5|7|8][0-9]{9}$"
))
{
throw
new
RuntimeException
(
"电话格式错误"
);
DataEaseException
.
throwException
(
Translator
.
get
(
"i18n_wrong_tel"
)
);
}
if
(!
request
.
getEmail
().
matches
(
"^[a-zA-Z0-9_._-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$"
))
{
throw
new
RuntimeException
(
"邮箱格式错误"
);
DataEaseException
.
throwException
(
Translator
.
get
(
"i18n_wrong_email"
)
);
}
if
(!(
2
<=
request
.
getNickName
().
length
()
&&
request
.
getNickName
().
length
()
<=
50
))
{
throw
new
RuntimeException
(
"姓名格式错误"
);
DataEaseException
.
throwException
(
Translator
.
get
(
"i18n_wrong_name_format"
)
);
}
sysUserService
.
updatePersonBasicInfo
(
request
);
}
...
...
backend/src/main/resources/i18n/messages_en_US.properties
浏览文件 @
9118b043
...
...
@@ -123,4 +123,8 @@ theme_name_empty=name can not be empty
i18n_public_chart
=
【Public Chart】
i18n_class_blue
=
Blue Tone
插件管理=Plugins
i18n_plugin_not_allow_delete
=
The plugin in in use cannot be deleted
\ No newline at end of file
i18n_plugin_not_allow_delete
=
The plugin in in use cannot be deleted
i18n_wrong_content
=
Wrong content
i18n_wrong_tel
=
Wrong tel format
i18n_wrong_email
=
Wrong email format
i18n_wrong_name_format
=
Wrong name format
backend/src/main/resources/i18n/messages_zh_CN.properties
浏览文件 @
9118b043
...
...
@@ -123,4 +123,8 @@ i18n_public_chart=【存量视图】
i18n_class_blue
=
蓝色调
插件管理=插件管理
i18n_plugin_not_allow_delete
=
正在使用的插件不允许删除
i18n_wrong_content
=
内容不合法
i18n_wrong_tel
=
电话格式错误
i18n_wrong_email
=
邮箱格式错误
i18n_wrong_name_format
=
姓名格式错误
backend/src/main/resources/i18n/messages_zh_TW.properties
浏览文件 @
9118b043
...
...
@@ -123,4 +123,8 @@ theme_name_empty=名稱不能為空
i18n_public_chart
=
【存量视图】
i18n_class_blue
=
蓝色调
插件管理=插件管理
i18n_plugin_not_allow_delete
=
正在使用的插件不允許刪除
\ No newline at end of file
i18n_plugin_not_allow_delete
=
正在使用的插件不允許刪除
i18n_wrong_content
=
內容不合法
i18n_wrong_tel
=
電話格式錯誤
i18n_wrong_email
=
郵箱格式錯誤
i18n_wrong_name_format
=
姓名格式錯誤
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论