Merge pull request #6449 from dataease/pr@dev@perf_del_admin

perf: 禁止删除admin账号
This commit is contained in:
fit2cloud-chenyw 2023-10-31 15:09:40 +08:00 committed by GitHub
commit 58633ddc9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 2 deletions

View File

@ -440,6 +440,9 @@ public class SysUserService {
@CacheEvict(value = AuthConstants.USER_CACHE_NAME, key = "'user' + #userId")
@Transactional
public int delete(Long userId) {
if (userId.equals(1L)) {
DEException.throwException(Translator.get("I18n_del_admin_tips"));
}
extAuthService.clearUserResource(userId);
deleteUserRoles(userId);
sysUserAssistMapper.deleteByPrimaryKey(userId);

View File

@ -275,3 +275,4 @@ I18N_PANEL_PDF_TEMPLATE_ONLY_PIC=Default template only screenshot
\u8FB9\u68469=Border 9
\u8FB9\u684610=Border 10
I18n_name_cant_empty=Name can not be empty!
I18n_del_admin_tips=Forbidden to delete the admin account

View File

@ -265,4 +265,5 @@ I18N_CRON_ERROR=cron\u8868\u8FBE\u5F0F\u9519\u8BEF
I18N_PANEL_PDF_TEMPLATE_WITH_PARAMS=\u9ED8\u8BA4\u6A21\u677F(\u52A0\u4EEA\u8868\u677F\u63CF\u8FF0)
I18N_PANEL_PDF_TEMPLATE_ONLY_PIC=\u9ED8\u8BA4\u6A21\u677F(\u53EA\u622A\u56FE)
I18n_name_cant_empty=\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A\uFF01
I18n_del_admin_tips=\u7981\u6B62\u5220\u9664admin\u8D26\u53F7

View File

@ -271,3 +271,4 @@ I18N_PANEL_PDF_TEMPLATE_ONLY_PIC=\u9ED8\u8A8D\u6A21\u677F(\u53EA\u622A\u5716)
\u8FB9\u68469=\u908A\u6846 9
\u8FB9\u684610=\u908A\u6846 10
I18n_name_cant_empty=\u540D\u7A31\u4E0D\u80FD\u70BA\u7A7A\uFF01
I18n_del_admin_tips=\u7981\u6B62\u522A\u9664admin\u8CEC\u865F