From 660f879ccddcc677ec33f90c72024e256e247343 Mon Sep 17 00:00:00 2001 From: FatttSnake Date: Fri, 22 Dec 2023 15:42:09 +0800 Subject: [PATCH] Fix can not remove expiration and credentialsExpiration from user bug --- .../api/service/permission/impl/UserServiceImpl.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/top/fatweb/api/service/permission/impl/UserServiceImpl.kt b/src/main/kotlin/top/fatweb/api/service/permission/impl/UserServiceImpl.kt index f35f537..151ecc8 100644 --- a/src/main/kotlin/top/fatweb/api/service/permission/impl/UserServiceImpl.kt +++ b/src/main/kotlin/top/fatweb/api/service/permission/impl/UserServiceImpl.kt @@ -84,7 +84,12 @@ class UserServiceImpl( PageUtil.setPageSort(userGetParam, userIdsPage, OrderItem.asc("id")) val userIdsIPage = - baseMapper.selectPage(userIdsPage,userGetParam?.searchType ?: "ALL", userGetParam?.searchValue, userGetParam?.searchRegex ?: false) + baseMapper.selectPage( + userIdsPage, + userGetParam?.searchType ?: "ALL", + userGetParam?.searchValue, + userGetParam?.searchRegex ?: false + ) val userPage = Page(userIdsIPage.current, userIdsIPage.size, userIdsIPage.total) if (userIdsIPage.total > 0) { userPage.setRecords(baseMapper.selectListWithRoleInfoByIds(userIdsIPage.records)) @@ -171,6 +176,10 @@ class UserServiceImpl( oldGroupList.toSet().let { addGroupIds.removeAll(it) } baseMapper.updateById(user) + baseMapper.update( + KtUpdateWrapper(User()).eq(User::id, user.id).set(User::expiration, user.expiration) + .set(User::credentialsExpiration, user.credentialsExpiration) + ) user.userInfo?.let { userInfo -> userInfoService.getOne(