org.springframework.boot
diff --git a/pig-common/pig-common-core/pom.xml b/pig-common/pig-common-core/pom.xml
index 434a19f8..e70f3b83 100755
--- a/pig-common/pig-common-core/pom.xml
+++ b/pig-common/pig-common-core/pom.xml
@@ -21,7 +21,7 @@
com.pig4cloud
pig-common
- 2.6.1
+ 2.6.2
pig-common-core
diff --git a/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/CacheConstants.java b/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/CacheConstants.java
new file mode 100644
index 00000000..9be27cea
--- /dev/null
+++ b/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/CacheConstants.java
@@ -0,0 +1,48 @@
+package com.pig4cloud.pig.common.core.constant;
+
+/**
+ * @author lengleng
+ * @date 2020年01月01日
+ *
+ * 缓存的key 常量
+ */
+public interface CacheConstants {
+
+ /**
+ * oauth 缓存前缀
+ */
+ String PROJECT_OAUTH_ACCESS = "pig_oauth:access:";
+
+ /**
+ * 验证码前缀
+ */
+ String DEFAULT_CODE_KEY = "DEFAULT_CODE_KEY:";
+
+
+ /**
+ * 菜单信息缓存
+ */
+ String MENU_DETAILS = "menu_details";
+
+ /**
+ * 用户信息缓存
+ */
+ String USER_DETAILS = "user_details";
+
+ /**
+ * 字典信息缓存
+ */
+ String DICT_DETAILS = "dict_details";
+
+
+ /**
+ * oauth 客户端信息
+ */
+ String CLIENT_DETAILS_KEY = "pig_oauth:client:details";
+
+
+ /**
+ * 参数缓存
+ */
+ String PARAMS_DETAILS = "params_details";
+}
diff --git a/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/CommonConstants.java b/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/CommonConstants.java
index 0cf370b3..cdd5b31f 100644
--- a/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/CommonConstants.java
+++ b/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/CommonConstants.java
@@ -73,4 +73,14 @@ public interface CommonConstants {
* 验证码前缀
*/
String DEFAULT_CODE_KEY = "DEFAULT_CODE_KEY_";
+
+ /**
+ * 当前页
+ */
+ String CURRENT = "current";
+
+ /**
+ * size
+ */
+ String SIZE = "size";
}
diff --git a/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/SecurityConstants.java b/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/SecurityConstants.java
index 835d152b..e5a12eb0 100755
--- a/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/SecurityConstants.java
+++ b/pig-common/pig-common-core/src/main/java/com/pig4cloud/pig/common/core/constant/SecurityConstants.java
@@ -30,10 +30,6 @@ public interface SecurityConstants {
*/
String PROJECT_PREFIX = "pig_";
- /**
- * oauth 相关前缀
- */
- String OAUTH_PREFIX = "oauth:";
/**
* 项目的license
*/
@@ -49,10 +45,6 @@ public interface SecurityConstants {
*/
String FROM = "from";
- /**
- * 手机号登录URL
- */
- String MOBILE_TOKEN_URL = "/mobile/token";
/**
* 默认登录URL
@@ -64,11 +56,6 @@ public interface SecurityConstants {
*/
String REFRESH_TOKEN = "refresh_token";
- /**
- * oauth 客户端信息
- */
- String CLIENT_DETAILS_KEY = PROJECT_PREFIX + OAUTH_PREFIX + "client:details";
-
/**
* {bcrypt} 加密的特征码
*/
diff --git a/pig-common/pig-common-log/pom.xml b/pig-common/pig-common-log/pom.xml
index 3d59b228..128bd15c 100755
--- a/pig-common/pig-common-log/pom.xml
+++ b/pig-common/pig-common-log/pom.xml
@@ -21,7 +21,7 @@
com.pig4cloud
pig-common
- 2.6.1
+ 2.6.2
pig-common-log
@@ -35,13 +35,13 @@
com.pig4cloud
pig-common-core
- 2.6.1
+ 2.6.2
com.pig4cloud
pig-upms-api
- 2.6.1
+ 2.6.2
diff --git a/pig-common/pig-common-security/pom.xml b/pig-common/pig-common-security/pom.xml
index 45faee1f..cbcfe628 100755
--- a/pig-common/pig-common-security/pom.xml
+++ b/pig-common/pig-common-security/pom.xml
@@ -21,7 +21,7 @@
com.pig4cloud
pig-common
- 2.6.1
+ 2.6.2
pig-common-security
@@ -35,7 +35,7 @@
com.pig4cloud
pig-common-core
- 2.6.1
+ 2.6.2
@@ -50,7 +50,7 @@
com.pig4cloud
pig-upms-api
- 2.6.1
+ 2.6.2
diff --git a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/handler/FormAuthenticationFailureHandler.java b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/handler/FormAuthenticationFailureHandler.java
new file mode 100644
index 00000000..9a8fd716
--- /dev/null
+++ b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/handler/FormAuthenticationFailureHandler.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2018-2025, lengleng All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * Neither the name of the pig4cloud.com developer nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ * Author: lengleng (wangiegie@gmail.com)
+ */
+
+package com.pig4cloud.pig.common.security.handler;
+
+import cn.hutool.http.HttpUtil;
+import lombok.SneakyThrows;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.web.authentication.AuthenticationFailureHandler;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.nio.charset.Charset;
+
+/**
+ * @author lengleng
+ * @date 2019-08-20
+ *
+ * 表单登录失败处理逻辑
+ */
+@Slf4j
+public class FormAuthenticationFailureHandler implements AuthenticationFailureHandler {
+ /**
+ * Called when an authentication attempt fails.
+ *
+ * @param request the request during which the authentication attempt occurred.
+ * @param response the response.
+ * @param exception the exception which was thrown to reject the authentication
+ */
+ @Override
+ @SneakyThrows
+ public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) {
+ log.debug("表单登录失败:{}", exception.getLocalizedMessage());
+ response.sendRedirect(String.format("/token/login?error=%s"
+ , HttpUtil.encodeParams(exception.getMessage(), Charset.defaultCharset())));
+ }
+}
diff --git a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/handler/MobileLoginSuccessHandler.java b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/handler/MobileLoginSuccessHandler.java
deleted file mode 100755
index 5f91ad04..00000000
--- a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/handler/MobileLoginSuccessHandler.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2019-2020, 冷冷 (wangiegie@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.gnu.org/licenses/lgpl.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.pig4cloud.pig.common.security.handler;
-
-import cn.hutool.core.map.MapUtil;
-import cn.hutool.core.util.CharsetUtil;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.pig4cloud.pig.common.core.constant.CommonConstants;
-import com.pig4cloud.pig.common.security.util.AuthUtils;
-import lombok.Builder;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.http.HttpHeaders;
-import org.springframework.security.authentication.BadCredentialsException;
-import org.springframework.security.core.Authentication;
-import org.springframework.security.crypto.password.PasswordEncoder;
-import org.springframework.security.oauth2.common.OAuth2AccessToken;
-import org.springframework.security.oauth2.common.exceptions.InvalidClientException;
-import org.springframework.security.oauth2.common.exceptions.UnapprovedClientAuthenticationException;
-import org.springframework.security.oauth2.provider.*;
-import org.springframework.security.oauth2.provider.request.DefaultOAuth2RequestValidator;
-import org.springframework.security.oauth2.provider.token.AuthorizationServerTokenServices;
-import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.PrintWriter;
-
-/**
- * @author lengleng
- * @date 2019/2/1
- * 手机号登录成功,返回oauth token
- */
-@Slf4j
-@Builder
-public class MobileLoginSuccessHandler implements AuthenticationSuccessHandler {
- private static final String BASIC_ = "Basic ";
- private ObjectMapper objectMapper;
- private PasswordEncoder passwordEncoder;
- private ClientDetailsService clientDetailsService;
- private AuthorizationServerTokenServices defaultAuthorizationServerTokenServices;
-
- /**
- * Called when a user has been successfully authenticated.
- * 调用spring security oauth API 生成 oAuth2AccessToken
- *
- * @param request the request which caused the successful authentication
- * @param response the response
- * @param authentication the Authentication object which was created during
- */
- @Override
- public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
- String header = request.getHeader(HttpHeaders.AUTHORIZATION);
-
- if (header == null || !header.startsWith(BASIC_)) {
- throw new UnapprovedClientAuthenticationException("请求头中client信息为空");
- }
-
- try {
- String[] tokens = AuthUtils.extractAndDecodeHeader(header);
- assert tokens.length == 2;
- String clientId = tokens[0];
-
- ClientDetails clientDetails = clientDetailsService.loadClientByClientId(clientId);
-
- //校验secret
- if (!passwordEncoder.matches(tokens[1], clientDetails.getClientSecret())) {
- throw new InvalidClientException("Given client ID does not match authenticated client");
-
- }
-
- TokenRequest tokenRequest = new TokenRequest(MapUtil.newHashMap(), clientId, clientDetails.getScope(), "mobile");
-
- //校验scope
- new DefaultOAuth2RequestValidator().validateScope(tokenRequest, clientDetails);
- OAuth2Request oAuth2Request = tokenRequest.createOAuth2Request(clientDetails);
- OAuth2Authentication oAuth2Authentication = new OAuth2Authentication(oAuth2Request, authentication);
- OAuth2AccessToken oAuth2AccessToken = defaultAuthorizationServerTokenServices.createAccessToken(oAuth2Authentication);
- log.info("获取token 成功:{}", oAuth2AccessToken.getValue());
-
- response.setCharacterEncoding(CharsetUtil.UTF_8);
- response.setContentType(CommonConstants.CONTENT_TYPE);
- PrintWriter printWriter = response.getWriter();
- printWriter.append(objectMapper.writeValueAsString(oAuth2AccessToken));
- } catch (IOException e) {
- throw new BadCredentialsException(
- "Failed to decode basic authentication token");
- }
- }
-
-
-}
diff --git a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigClientDetailsService.java b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigClientDetailsService.java
index 7bf9e3c7..94268f10 100755
--- a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigClientDetailsService.java
+++ b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigClientDetailsService.java
@@ -16,10 +16,9 @@
package com.pig4cloud.pig.common.security.service;
-import com.pig4cloud.pig.common.core.constant.SecurityConstants;
+import com.pig4cloud.pig.common.core.constant.CacheConstants;
import lombok.SneakyThrows;
import org.springframework.cache.annotation.Cacheable;
-import org.springframework.security.oauth2.common.exceptions.InvalidClientException;
import org.springframework.security.oauth2.provider.ClientDetails;
import org.springframework.security.oauth2.provider.client.JdbcClientDetailsService;
@@ -45,7 +44,7 @@ public class PigClientDetailsService extends JdbcClientDetailsService {
*/
@Override
@SneakyThrows
- @Cacheable(value = SecurityConstants.CLIENT_DETAILS_KEY, key = "#clientId", unless = "#result == null")
+ @Cacheable(value = CacheConstants.CLIENT_DETAILS_KEY, key = "#clientId", unless = "#result == null")
public ClientDetails loadClientByClientId(String clientId) {
return super.loadClientByClientId(clientId);
}
diff --git a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUserDetailsServiceImpl.java b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUserDetailsServiceImpl.java
index 0c066193..e4babcf9 100755
--- a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUserDetailsServiceImpl.java
+++ b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/service/PigUserDetailsServiceImpl.java
@@ -21,6 +21,7 @@ import cn.hutool.core.util.StrUtil;
import com.pig4cloud.pig.admin.api.dto.UserInfo;
import com.pig4cloud.pig.admin.api.entity.SysUser;
import com.pig4cloud.pig.admin.api.feign.RemoteUserService;
+import com.pig4cloud.pig.common.core.constant.CacheConstants;
import com.pig4cloud.pig.common.core.constant.CommonConstants;
import com.pig4cloud.pig.common.core.constant.SecurityConstants;
import com.pig4cloud.pig.common.core.util.R;
@@ -62,7 +63,7 @@ public class PigUserDetailsServiceImpl implements UserDetailsService {
@Override
@SneakyThrows
public UserDetails loadUserByUsername(String username) {
- Cache cache = cacheManager.getCache("user_details");
+ Cache cache = cacheManager.getCache(CacheConstants.USER_DETAILS);
if (cache != null && cache.get(username) != null) {
return (PigUser) cache.get(username).get();
}
diff --git a/pig-common/pig-common-swagger/pom.xml b/pig-common/pig-common-swagger/pom.xml
index 9518114c..5a29a080 100644
--- a/pig-common/pig-common-swagger/pom.xml
+++ b/pig-common/pig-common-swagger/pom.xml
@@ -24,7 +24,7 @@
com.pig4cloud
pig-common
- 2.6.1
+ 2.6.2
pig-common-swagger
@@ -40,11 +40,5 @@
springfox-swagger2
${swagger.fox.version}
-
-
- com.github.xiaoymin
- knife4j-micro-spring-boot-starter
- ${knife4j.version}
-
diff --git a/pig-common/pom.xml b/pig-common/pom.xml
index 78d7b192..e4efee6d 100755
--- a/pig-common/pom.xml
+++ b/pig-common/pom.xml
@@ -21,7 +21,7 @@
com.pig4cloud
pig
- 2.6.1
+ 2.6.2
pig-common
diff --git a/pig-gateway/pom.xml b/pig-gateway/pom.xml
index 5af324b4..cf2ed906 100755
--- a/pig-gateway/pom.xml
+++ b/pig-gateway/pom.xml
@@ -21,7 +21,7 @@
com.pig4cloud
pig
- 2.6.1
+ 2.6.2
pig-gateway
@@ -59,7 +59,7 @@
com.pig4cloud
pig-common-core
- 2.6.1
+ 2.6.2
@@ -70,7 +70,7 @@
com.pig4cloud
pig-common-swagger
- 2.6.1
+ 2.6.2
diff --git a/pig-monitor/pom.xml b/pig-monitor/pom.xml
index eb736bab..b8f2f9ec 100755
--- a/pig-monitor/pom.xml
+++ b/pig-monitor/pom.xml
@@ -21,7 +21,7 @@
com.pig4cloud
pig
- 2.6.1
+ 2.6.2
pig-monitor
@@ -46,18 +46,6 @@
com.alibaba.cloud
spring-cloud-starter-alibaba-nacos-config
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- spring-boot-starter-tomcat
- org.springframework.boot
-
-
-
org.springframework.boot
diff --git a/pig-register/pom.xml b/pig-register/pom.xml
index 0d59bea1..64a9c04c 100755
--- a/pig-register/pom.xml
+++ b/pig-register/pom.xml
@@ -18,7 +18,7 @@
com.pig4cloud
pig
- 2.6.1
+ 2.6.2
pig-register
diff --git a/pig-upms/pig-upms-api/pom.xml b/pig-upms/pig-upms-api/pom.xml
index 0537ae6d..6dfbefb3 100755
--- a/pig-upms/pig-upms-api/pom.xml
+++ b/pig-upms/pig-upms-api/pom.xml
@@ -21,7 +21,7 @@
com.pig4cloud
pig-upms
- 2.6.1
+ 2.6.2
pig-upms-api
@@ -35,7 +35,7 @@
com.pig4cloud
pig-common-core
- 2.6.1
+ 2.6.2
diff --git a/pig-upms/pig-upms-biz/pom.xml b/pig-upms/pig-upms-biz/pom.xml
index 37ec865d..c7f9fcd6 100644
--- a/pig-upms/pig-upms-biz/pom.xml
+++ b/pig-upms/pig-upms-biz/pom.xml
@@ -21,7 +21,7 @@
com.pig4cloud
pig-upms
- 2.6.1
+ 2.6.2
pig-upms-biz
@@ -34,25 +34,25 @@
com.pig4cloud
pig-upms-api
- 2.6.1
+ 2.6.2
com.pig4cloud
pig-common-security
- 2.6.1
+ 2.6.2
com.pig4cloud
pig-common-log
- 2.6.1
+ 2.6.2
com.pig4cloud
pig-common-swagger
- 2.6.1
+ 2.6.2
@@ -75,18 +75,6 @@
mysql
mysql-connector-java
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- spring-boot-starter-tomcat
- org.springframework.boot
-
-
-
org.springframework.boot
diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java
index 2f854f3c..dc23c821 100644
--- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java
+++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysMenuServiceImpl.java
@@ -25,7 +25,7 @@ import com.pig4cloud.pig.admin.api.vo.MenuVO;
import com.pig4cloud.pig.admin.mapper.SysMenuMapper;
import com.pig4cloud.pig.admin.mapper.SysRoleMenuMapper;
import com.pig4cloud.pig.admin.service.SysMenuService;
-import com.pig4cloud.pig.common.core.constant.CommonConstants;
+import com.pig4cloud.pig.common.core.constant.CacheConstants;
import com.pig4cloud.pig.common.core.util.R;
import lombok.AllArgsConstructor;
import org.springframework.cache.annotation.CacheEvict;
@@ -49,14 +49,14 @@ public class SysMenuServiceImpl extends ServiceImpl impl
private final SysRoleMenuMapper sysRoleMenuMapper;
@Override
- @Cacheable(value = "menu_details", key = "#roleId + '_menu'")
+ @Cacheable(value = CacheConstants.MENU_DETAILS, key = "#roleId + '_menu'")
public List getMenuByRoleId(Integer roleId) {
return baseMapper.listMenusByRoleId(roleId);
}
@Override
@Transactional(rollbackFor = Exception.class)
- @CacheEvict(value = "menu_details", allEntries = true)
+ @CacheEvict(value = CacheConstants.MENU_DETAILS, allEntries = true)
public R removeMenuById(Integer id) {
// 查询父节点为当前节点的节点
List menuList = this.list(Wrappers.query()
@@ -74,7 +74,7 @@ public class SysMenuServiceImpl extends ServiceImpl impl
}
@Override
- @CacheEvict(value = "menu_details", allEntries = true)
+ @CacheEvict(value = CacheConstants.MENU_DETAILS, allEntries = true)
public Boolean updateMenuById(SysMenu sysMenu) {
return this.updateById(sysMenu);
}
diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysOauthClientDetailsServiceImpl.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysOauthClientDetailsServiceImpl.java
index 6d9974a5..f70e2f5f 100644
--- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysOauthClientDetailsServiceImpl.java
+++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysOauthClientDetailsServiceImpl.java
@@ -20,7 +20,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pig.admin.api.entity.SysOauthClientDetails;
import com.pig4cloud.pig.admin.mapper.SysOauthClientDetailsMapper;
import com.pig4cloud.pig.admin.service.SysOauthClientDetailsService;
-import com.pig4cloud.pig.common.core.constant.SecurityConstants;
+import com.pig4cloud.pig.common.core.constant.CacheConstants;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
@@ -42,7 +42,7 @@ public class SysOauthClientDetailsServiceImpl extends ServiceImplquery().lambda()
.eq(SysRoleMenu::getRoleId, roleId));
@@ -71,7 +72,7 @@ public class SysRoleMenuServiceImpl extends ServiceImpl impl
* @return
*/
@Override
- @CacheEvict(value = "menu_details", allEntries = true)
+ @CacheEvict(value = CacheConstants.MENU_DETAILS, allEntries = true)
@Transactional(rollbackFor = Exception.class)
public Boolean removeRoleById(Integer id) {
sysRoleMenuMapper.delete(Wrappers
diff --git a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java
index 9d6fae14..44b9f2af 100644
--- a/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java
+++ b/pig-upms/pig-upms-biz/src/main/java/com/pig4cloud/pig/admin/service/impl/SysUserServiceImpl.java
@@ -24,14 +24,17 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pig4cloud.pig.admin.api.dto.UserDTO;
import com.pig4cloud.pig.admin.api.dto.UserInfo;
-import com.pig4cloud.pig.admin.api.entity.*;
+import com.pig4cloud.pig.admin.api.entity.SysDept;
+import com.pig4cloud.pig.admin.api.entity.SysRole;
+import com.pig4cloud.pig.admin.api.entity.SysUser;
+import com.pig4cloud.pig.admin.api.entity.SysUserRole;
import com.pig4cloud.pig.admin.api.vo.MenuVO;
import com.pig4cloud.pig.admin.api.vo.UserVO;
import com.pig4cloud.pig.admin.mapper.SysUserMapper;
import com.pig4cloud.pig.admin.service.*;
+import com.pig4cloud.pig.common.core.constant.CacheConstants;
import com.pig4cloud.pig.common.core.constant.CommonConstants;
import com.pig4cloud.pig.common.core.util.R;
-import com.pig4cloud.pig.common.security.util.SecurityUtils;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
@@ -148,7 +151,7 @@ public class SysUserServiceImpl extends ServiceImpl impl
* @return Boolean
*/
@Override
- @CacheEvict(value = "user_details", key = "#sysUser.username")
+ @CacheEvict(value = CacheConstants.USER_DETAILS, key = "#sysUser.username")
public Boolean removeUserById(SysUser sysUser) {
sysUserRoleService.removeRoleByUserId(sysUser.getUserId());
this.removeById(sysUser.getUserId());
@@ -156,7 +159,7 @@ public class SysUserServiceImpl extends ServiceImpl impl
}
@Override
- @CacheEvict(value = "user_details", key = "#userDto.username")
+ @CacheEvict(value =CacheConstants.USER_DETAILS, key = "#userDto.username")
public R updateUserInfo(UserDTO userDto) {
UserVO userVO = baseMapper.getUserVoByUsername(userDto.getUsername());
SysUser sysUser = new SysUser();
@@ -176,7 +179,7 @@ public class SysUserServiceImpl extends ServiceImpl impl
}
@Override
- @CacheEvict(value = "user_details", key = "#userDto.username")
+ @CacheEvict(value = CacheConstants.USER_DETAILS, key = "#userDto.username")
public Boolean updateUser(UserDTO userDto) {
SysUser sysUser = new SysUser();
BeanUtils.copyProperties(userDto, sysUser);
@@ -218,21 +221,4 @@ public class SysUserServiceImpl extends ServiceImpl impl
return this.list(Wrappers.query().lambda()
.eq(SysUser::getDeptId, parentId));
}
-
- /**
- * 获取当前用户的子部门信息
- *
- * @return 子部门列表
- */
- private List getChildDepts() {
- Integer deptId = SecurityUtils.getUser().getDeptId();
- //获取当前部门的子部门
- return sysDeptRelationService
- .list(Wrappers.query().lambda()
- .eq(SysDeptRelation::getAncestor, deptId))
- .stream()
- .map(SysDeptRelation::getDescendant)
- .collect(Collectors.toList());
- }
-
}
diff --git a/pig-upms/pom.xml b/pig-upms/pom.xml
index 83401a9b..58734633 100755
--- a/pig-upms/pom.xml
+++ b/pig-upms/pom.xml
@@ -21,7 +21,7 @@
com.pig4cloud
pig
- 2.6.1
+ 2.6.2
pig-upms
diff --git a/pom.xml b/pom.xml
index 1794c3aa..d71bb634 100755
--- a/pom.xml
+++ b/pom.xml
@@ -27,28 +27,26 @@
com.pig4cloud
pig
- 2.6.1
+ 2.6.2
${project.artifactId}
pom
https://www.pig4cloud.com
2.2.2.RELEASE
- Hoxton.RELEASE
+ Hoxton.SR1
2.1.1.RELEASE
Cairo-SR8
UTF-8
1.8
1.8
- 2.2.0
- 5.0.6
+ 2.2.1
+ 5.1.0
3.3.0
0.0.9
1.7
2.1.0
2.9.2
- 1.9.6
- 2.3.6.RELEASE
@@ -134,11 +132,18 @@
pom
import
-
+
- org.springframework.security.oauth
- spring-security-oauth2
- ${security.oauth.version}
+ org.springframework.boot
+ spring-boot-starter-web
+ ${spring-boot.version}
+
+
+
+ spring-boot-starter-tomcat
+ org.springframework.boot
+
+
@@ -171,15 +176,6 @@
-
- maven-compiler-plugin
- 3.8.0
-
- ${maven.compiler.target}
- ${maven.compiler.source}
- ${project.build.sourceEncoding}
-
-
pl.project13.maven
git-commit-id-plugin