From 82567ffb91118cb5b27e9b5113be0f835b488626 Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Fri, 17 Jun 2022 11:39:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=95=B4=E7=90=86=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 7 - Dockerfile-jnhb | 7 - pom.xml | 40 --- .../DingDingAuthenticationFilter.java | 48 ---- .../DingDingAuthenticationProvider.java | 109 -------- .../dingding/DingDingAuthenticationToken.java | 62 ----- .../config/DingDingSecurityConfig.java | 77 ------ .../config/UserSecurityConfig.java | 6 +- .../config/WebSecurityConfig.java | 21 -- .../apis/system/AppRegisterController.java | 18 -- .../app/apis/system/AppSignController.java | 28 +- .../system/user/MiniUserAppController.java | 44 ---- .../apis/system/user/UserAppController.java | 60 +---- .../apis/user/DingDingUserController.java | 46 ---- .../system/user/IDingDingUserService.java | 17 -- .../service/system/user/IMiniUserService.java | 27 -- .../user/impl/DingDingUserServiceImpl.java | 212 ---------------- .../system/user/impl/MiniUserServiceImpl.java | 48 ---- src/main/resources/application-btgxq.yml | 167 ------------ src/main/resources/application-btyj.yml | 168 ------------ src/main/resources/application-dev.yml | 239 ----------------- src/main/resources/application-jnhb.yml | 240 ------------------ 22 files changed, 8 insertions(+), 1683 deletions(-) delete mode 100644 Dockerfile delete mode 100644 Dockerfile-jnhb delete mode 100644 src/main/java/com/cm/serviceusercenter/authentication/dingding/DingDingAuthenticationFilter.java delete mode 100644 src/main/java/com/cm/serviceusercenter/authentication/dingding/DingDingAuthenticationProvider.java delete mode 100644 src/main/java/com/cm/serviceusercenter/authentication/dingding/DingDingAuthenticationToken.java delete mode 100644 src/main/java/com/cm/serviceusercenter/config/DingDingSecurityConfig.java delete mode 100644 src/main/java/com/cm/serviceusercenter/controller/app/apis/system/user/MiniUserAppController.java delete mode 100644 src/main/java/com/cm/serviceusercenter/controller/dingding/apis/user/DingDingUserController.java delete mode 100644 src/main/java/com/cm/serviceusercenter/service/system/user/IDingDingUserService.java delete mode 100644 src/main/java/com/cm/serviceusercenter/service/system/user/IMiniUserService.java delete mode 100644 src/main/java/com/cm/serviceusercenter/service/system/user/impl/DingDingUserServiceImpl.java delete mode 100644 src/main/java/com/cm/serviceusercenter/service/system/user/impl/MiniUserServiceImpl.java delete mode 100644 src/main/resources/application-btgxq.yml delete mode 100644 src/main/resources/application-btyj.yml delete mode 100644 src/main/resources/application-dev.yml delete mode 100644 src/main/resources/application-jnhb.yml diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index b1d9013..0000000 --- a/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM openjdk:8u292-jre-buster -ARG JAR_FILE=/target/*.jar -COPY ${JAR_FILE} service-user-center.jar -ENTRYPOINT ["java","-jar","-Dspring.profiles.active=dev","/service-user-center.jar"] - -# 时区问题 -RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone \ No newline at end of file diff --git a/Dockerfile-jnhb b/Dockerfile-jnhb deleted file mode 100644 index a4e8af0..0000000 --- a/Dockerfile-jnhb +++ /dev/null @@ -1,7 +0,0 @@ -FROM openjdk:8u292-jre-buster -ARG JAR_FILE=/target/*.jar -COPY ${JAR_FILE} service-user-center.jar -ENTRYPOINT ["java","-jar","-Dspring.profiles.active=jnhb","/service-user-center.jar"] - -# 时区问题 -RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone \ No newline at end of file diff --git a/pom.xml b/pom.xml index e6fa4e7..c4518a1 100644 --- a/pom.xml +++ b/pom.xml @@ -52,22 +52,6 @@ spring-boot-starter-test test - - org.springframework.boot - spring-boot-starter-actuator - - - - org.springframework @@ -104,30 +88,6 @@ 1.0.2-SNAPSHOT - - com.cm - cloud-manager-sms - 1.0.2-SNAPSHOT - - - - com.cm - cloud-common-websocket - 1.0.2-SNAPSHOT - - - - com.cm - cloud-common-wechat - 1.0.2-SNAPSHOT - - - - com.cm - cloud-common-dingding - 1.0.2-SNAPSHOT - - org.projectlombok lombok diff --git a/src/main/java/com/cm/serviceusercenter/authentication/dingding/DingDingAuthenticationFilter.java b/src/main/java/com/cm/serviceusercenter/authentication/dingding/DingDingAuthenticationFilter.java deleted file mode 100644 index e9466f7..0000000 --- a/src/main/java/com/cm/serviceusercenter/authentication/dingding/DingDingAuthenticationFilter.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.cm.serviceusercenter.authentication.dingding; - -import com.cm.serviceusercenter.authentication.BaseAuthenticationProcessingFilter; -import com.cm.serviceusercenter.authentication.user.UserAuthenticationToken; -import com.cm.serviceusercenter.exception.UserAuthenticationException; -import org.apache.commons.lang3.StringUtils; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.AuthenticationException; -import org.springframework.security.web.util.matcher.AntPathRequestMatcher; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * When you feel like quitting. Think about why you started - * 当你想要放弃的时候,想想当初你为何开始 - * - * @ClassName: DingDingAuthenticationFilter - * @Description: 钉钉扫码登录过滤器 - * @Author: WangGeng - * @Date: 2020/8/31 2:50 下午 - * @Version: 1.0 - **/ -public class DingDingAuthenticationFilter extends BaseAuthenticationProcessingFilter { - - public DingDingAuthenticationFilter(String loginProcessUrl) { - super(new AntPathRequestMatcher(loginProcessUrl + "/dingding", "GET")); - } - - @Override - public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException { - String loginTmpCode = request.getParameter(DING_DING_LOGIN_TMP_CODE); - if (StringUtils.isBlank(loginTmpCode)) { - throw new UserAuthenticationException("验证失败,请重新扫码"); - } - loginTmpCode = loginTmpCode.trim(); - DingDingAuthenticationToken authRequest = new DingDingAuthenticationToken(loginTmpCode, null); - setDetails(request, authRequest); - return this.getAuthenticationManager().authenticate(authRequest); - } - - protected void setDetails(HttpServletRequest request, DingDingAuthenticationToken authRequest) { - authRequest.setDetails(authenticationDetailsSource.buildDetails(request)); - } - -} diff --git a/src/main/java/com/cm/serviceusercenter/authentication/dingding/DingDingAuthenticationProvider.java b/src/main/java/com/cm/serviceusercenter/authentication/dingding/DingDingAuthenticationProvider.java deleted file mode 100644 index 82ccc09..0000000 --- a/src/main/java/com/cm/serviceusercenter/authentication/dingding/DingDingAuthenticationProvider.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.cm.serviceusercenter.authentication.dingding; - -import com.cm.common.dingding.service.IDingDingAppUserService; -import com.cm.common.exception.SearchException; -import com.cm.common.pojo.bos.UserBO; -import com.cm.serviceusercenter.authentication.user.UserAuthenticationToken; -import com.cm.serviceusercenter.config.properties.DingDingScanCodeLoginProperties; -import com.cm.serviceusercenter.enums.LoginType; -import com.cm.serviceusercenter.exception.UserAuthenticationException; -import com.cm.serviceusercenter.service.UserLoginService; -import com.dingtalk.api.DefaultDingTalkClient; -import com.dingtalk.api.request.OapiSnsGetuserinfoBycodeRequest; -import com.dingtalk.api.response.OapiSnsGetuserinfoBycodeResponse; -import com.dingtalk.api.response.OapiUserGetResponse; -import com.taobao.api.ApiException; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.security.authentication.AuthenticationProvider; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.AuthenticationException; -import org.springframework.security.core.userdetails.UserDetailsService; - -/** - * When you feel like quitting. Think about why you started - * 当你想要放弃的时候,想想当初你为何开始 - * - * @ClassName: DingDingAuthenticationProvider - * @Description: 钉钉登陆认证 - * @Author: WangGeng - * @Date: 2020/8/31 15:10 - * @Version: 1.0 - **/ -public class DingDingAuthenticationProvider implements AuthenticationProvider { - - private static final Logger LOG = LoggerFactory.getLogger(DingDingAuthenticationProvider.class); - private DingDingScanCodeLoginProperties dingDingScanCodeLoginProperties; - private IDingDingAppUserService dingDingAppUserService; - private UserDetailsService userDetailsService; - private UserLoginService userLoginService; - - @Override - public Authentication authenticate(Authentication authentication) throws AuthenticationException { - DingDingAuthenticationToken dingDingAuthenticationToken = (DingDingAuthenticationToken) authentication; - String userMobile = null; - try { - String unionId = getUnionIdByTmpAuthCode(dingDingAuthenticationToken.getPrincipal().toString()); - String userId = dingDingAppUserService.getUserIdByUnionId(unionId); - OapiUserGetResponse oapiUserGetResponse = dingDingAppUserService.getUserByUserId(userId); - userMobile = oapiUserGetResponse.getMobile(); - } catch (SearchException e) { - throw new UserAuthenticationException(e.getMessage()); - } - if (StringUtils.isBlank(userMobile)) { - throw new UserAuthenticationException("钉钉账号未绑定手机号,请绑定后再试"); - } - UserBO userBO = (UserBO) userDetailsService.loadUserByUsername(userMobile); - if (userBO == null) { - throw new UserAuthenticationException("该钉钉手机号账号不在系统中,请联系管理员"); - } - userLoginService.updateUserLoginInfo(userBO.getUserId(), userBO.getUserName(), LoginType.DING_DING_SCAN_CODE.getValue()); - DingDingAuthenticationToken dingDingAuthenticationTokenResult = new DingDingAuthenticationToken(userBO, null, userBO.getAuthorities()); - dingDingAuthenticationTokenResult.setDetails(dingDingAuthenticationToken.getDetails()); - return dingDingAuthenticationTokenResult; - } - - @Override - public boolean supports(Class authentication) { - return DingDingAuthenticationToken.class.isAssignableFrom(authentication); - } - - public void setDingDingScanCodeLoginProperties(DingDingScanCodeLoginProperties dingDingScanCodeLoginProperties) { - this.dingDingScanCodeLoginProperties = dingDingScanCodeLoginProperties; - } - - public void setDingDingAppUserService(IDingDingAppUserService dingDingAppUserService) { - this.dingDingAppUserService = dingDingAppUserService; - } - - public void setUserDetailsService(UserDetailsService userDetailsService) { - this.userDetailsService = userDetailsService; - } - - public void setUserLoginService(UserLoginService userLoginService) { - this.userLoginService = userLoginService; - } - - /** - * 获取用户unionId - * - * @param tmpAuthCode - * @return - */ - private String getUnionIdByTmpAuthCode(String tmpAuthCode) { - DefaultDingTalkClient defaultDingTalkClient = new DefaultDingTalkClient(dingDingScanCodeLoginProperties.getUserinfoUrl()); - OapiSnsGetuserinfoBycodeRequest oapiSnsGetuserinfoBycodeRequest = new OapiSnsGetuserinfoBycodeRequest(); - oapiSnsGetuserinfoBycodeRequest.setTmpAuthCode(tmpAuthCode); - try { - OapiSnsGetuserinfoBycodeResponse oapiSnsGetuserinfoBycodeResponse = defaultDingTalkClient.execute(oapiSnsGetuserinfoBycodeRequest, dingDingScanCodeLoginProperties.getAppId(), dingDingScanCodeLoginProperties.getAppSecret()); - if (oapiSnsGetuserinfoBycodeResponse.getErrcode() != 0) { - throw new SearchException(oapiSnsGetuserinfoBycodeResponse.getErrmsg()); - } - return oapiSnsGetuserinfoBycodeResponse.getUserInfo().getUnionid(); - } catch (ApiException e) { - LOG.error(e.getMessage(), e); - throw new SearchException("钉钉扫码失败"); - } - } -} diff --git a/src/main/java/com/cm/serviceusercenter/authentication/dingding/DingDingAuthenticationToken.java b/src/main/java/com/cm/serviceusercenter/authentication/dingding/DingDingAuthenticationToken.java deleted file mode 100644 index d8bb5e0..0000000 --- a/src/main/java/com/cm/serviceusercenter/authentication/dingding/DingDingAuthenticationToken.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.cm.serviceusercenter.authentication.dingding; - -import org.springframework.security.authentication.AbstractAuthenticationToken; -import org.springframework.security.core.GrantedAuthority; - -import java.util.Collection; - -/** - * When you feel like quitting. Think about why you started - * 当你想要放弃的时候,想想当初你为何开始 - * - * @ClassName: DingDingAuthenticationToken - * @Description: 钉钉认证Token - * @Author: WangGeng - * @Date: 2020/8/31 15:11 - * @Version: 1.0 - **/ -public class DingDingAuthenticationToken extends AbstractAuthenticationToken { - - private final Object principal; - private Object credentials; - - public DingDingAuthenticationToken(Object principal, Object credentials) { - super(null); - this.principal = principal; - this.credentials = credentials; - setAuthenticated(false); - } - - public DingDingAuthenticationToken(Object principal, Object credentials, - Collection authorities) { - super(authorities); - this.principal = principal; - this.credentials = credentials; - super.setAuthenticated(true); - } - - @Override - public Object getCredentials() { - return this.credentials; - } - - @Override - public Object getPrincipal() { - return this.principal; - } - - @Override - public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException { - if (isAuthenticated) { - throw new IllegalArgumentException( - "Cannot set this token to trusted - use constructor which takes a GrantedAuthority list instead"); - } - super.setAuthenticated(false); - } - - @Override - public void eraseCredentials() { - super.eraseCredentials(); - credentials = null; - } -} diff --git a/src/main/java/com/cm/serviceusercenter/config/DingDingSecurityConfig.java b/src/main/java/com/cm/serviceusercenter/config/DingDingSecurityConfig.java deleted file mode 100644 index 44c6fa0..0000000 --- a/src/main/java/com/cm/serviceusercenter/config/DingDingSecurityConfig.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.cm.serviceusercenter.config; - -import com.cm.common.dingding.service.IDingDingAppUserService; -import com.cm.serviceusercenter.authentication.dingding.DingDingAuthenticationFilter; -import com.cm.serviceusercenter.authentication.dingding.DingDingAuthenticationProvider; -import com.cm.serviceusercenter.authentication.ukey.UKeyAuthenticationFilter; -import com.cm.serviceusercenter.authentication.user.UserAuthenticationFilter; -import com.cm.serviceusercenter.config.properties.DingDingScanCodeLoginProperties; -import com.cm.serviceusercenter.handler.LoginFailureHandler; -import com.cm.serviceusercenter.service.UserDetailServiceImpl; -import com.cm.serviceusercenter.service.UserLoginService; -import org.springframework.security.authentication.AuthenticationManager; -import org.springframework.security.config.annotation.SecurityConfigurerAdapter; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.crypto.password.PasswordEncoder; -import org.springframework.security.web.DefaultSecurityFilterChain; - -/** - * When you feel like quitting. Think about why you started - * 当你想要放弃的时候,想想当初你为何开始 - * - * @ClassName: DingDingSecurityConfig - * @Description: 钉钉安全配置 - * @Author: WangGeng - * @Date: 2020/8/31 15:12 - * @Version: 1.0 - **/ -public class DingDingSecurityConfig extends SecurityConfigurerAdapter { - - private DingDingScanCodeLoginProperties dingDingScanCodeLoginProperties; - private UserDetailServiceImpl userDetailService; - private LoginFailureHandler loginFailureHandler; - private String loginProcessUrl; - private UserLoginService userLoginService; - private IDingDingAppUserService dingDingAppUserService; - - @Override - public void configure(HttpSecurity http) throws Exception { - super.configure(http); - // 创建过滤器 - DingDingAuthenticationFilter dingDingAuthenticationFilter = new DingDingAuthenticationFilter(loginProcessUrl); - dingDingAuthenticationFilter.setAuthenticationManager(http.getSharedObject(AuthenticationManager.class)); - dingDingAuthenticationFilter.setAuthenticationFailureHandler(loginFailureHandler); - // 创建provider,加入UserDetailService - DingDingAuthenticationProvider dingDingAuthenticationProvider = new DingDingAuthenticationProvider(); - dingDingAuthenticationProvider.setDingDingScanCodeLoginProperties(dingDingScanCodeLoginProperties); - dingDingAuthenticationProvider.setUserDetailsService(userDetailService); - dingDingAuthenticationProvider.setUserLoginService(userLoginService); - dingDingAuthenticationProvider.setDingDingAppUserService(dingDingAppUserService); - // 加入SpringSecurity的authentication管理的provider集合当中,并且添加到UKeyAuthenticationFilter之前 - http.authenticationProvider(dingDingAuthenticationProvider).addFilterBefore(dingDingAuthenticationFilter, UKeyAuthenticationFilter.class); - } - - public void setDingDingScanCodeLoginProperties(DingDingScanCodeLoginProperties dingDingScanCodeLoginProperties) { - this.dingDingScanCodeLoginProperties = dingDingScanCodeLoginProperties; - } - - public void setUserDetailService(UserDetailServiceImpl userDetailService) { - this.userDetailService = userDetailService; - } - - public void setLoginFailureHandler(LoginFailureHandler loginFailureHandler) { - this.loginFailureHandler = loginFailureHandler; - } - - public void setLoginProcessUrl(String loginProcessUrl) { - this.loginProcessUrl = loginProcessUrl; - } - - public void setUserLoginService(UserLoginService userLoginService) { - this.userLoginService = userLoginService; - } - - public void setDingDingAppUserService(IDingDingAppUserService dingDingAppUserService) { - this.dingDingAppUserService = dingDingAppUserService; - } -} diff --git a/src/main/java/com/cm/serviceusercenter/config/UserSecurityConfig.java b/src/main/java/com/cm/serviceusercenter/config/UserSecurityConfig.java index 4b42ddb..50d8982 100644 --- a/src/main/java/com/cm/serviceusercenter/config/UserSecurityConfig.java +++ b/src/main/java/com/cm/serviceusercenter/config/UserSecurityConfig.java @@ -1,7 +1,5 @@ package com.cm.serviceusercenter.config; -import com.cm.serviceusercenter.authentication.dingding.DingDingAuthenticationFilter; -import com.cm.serviceusercenter.authentication.ukey.UKeyAuthenticationFilter; import com.cm.serviceusercenter.authentication.user.UserAuthenticationFilter; import com.cm.serviceusercenter.authentication.user.UserAuthenticationProvider; import com.cm.serviceusercenter.handler.LoginFailureHandler; @@ -12,7 +10,6 @@ import org.springframework.security.config.annotation.SecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.web.DefaultSecurityFilterChain; -import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; /** * When you feel like quitting. Think about why you started @@ -44,8 +41,7 @@ public class UserSecurityConfig extends SecurityConfigurerAdapter loginPhone(@RequestBody LoginPhoneVO loginPhoneVO) throws Exception { - if (!RegexUtil.isPhone(loginPhoneVO.getUsername())) { - throw new ParamsException("用户名非手机格式"); - } - String verificationCode = VerificationCodeManager.getInstance().getVerificationCode(loginPhoneVO.getUsername()); - if (StringUtils.isBlank(verificationCode)) { - throw new ParamsException("验证码为空"); - } - if (!StringUtils.equalsIgnoreCase(verificationCode, loginPhoneVO.getVerificationCode())) { - throw new ParamsException("验证码错误"); - } - return signService.loginPhone(loginPhoneVO); - } - } diff --git a/src/main/java/com/cm/serviceusercenter/controller/app/apis/system/user/MiniUserAppController.java b/src/main/java/com/cm/serviceusercenter/controller/app/apis/system/user/MiniUserAppController.java deleted file mode 100644 index d02a31b..0000000 --- a/src/main/java/com/cm/serviceusercenter/controller/app/apis/system/user/MiniUserAppController.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.cm.serviceusercenter.controller.app.apis.system.user; - -import com.cm.common.annotation.CheckRequestBodyAnnotation; -import com.cm.common.constants.ISystemConstant; -import com.cm.common.result.SuccessResultData; -import com.cm.serviceusercenter.controller.BaseController; -import com.cm.serviceusercenter.pojo.vos.user.WechatUserDataVO; -import com.cm.serviceusercenter.service.system.user.IMiniUserService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiImplicitParams; -import io.swagger.annotations.ApiOperation; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -/** - * When you feel like quitting. Think about why you started - * 当你想要放弃的时候,想想当初你为何开始 - * - * @ClassName: UserMiniAppController - * @Description: 微信小程序接口 - * @Author: WangGeng - * @Date: 2020/10/29 17:59 - * @Version: 1.0 - **/ -@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "小程序用户管理") -@RestController -@RequestMapping(ISystemConstant.APP_PREFIX + "/miniuser") -public class MiniUserAppController extends BaseController { - - @Autowired - private IMiniUserService miniUserService; - - @ApiOperation(value = "更新小程序默认用户名", notes = "更新小程序默认用户名(通过小程序用户加密数据)") - @ApiImplicitParams({ - @ApiImplicitParam(name = "token", value = "token", paramType = "header"), - }) - @PutMapping("updatedefaultusernamebydata") - @CheckRequestBodyAnnotation - public SuccessResultData updateDefaultUsernameByData(@RequestHeader("token") String token, @RequestBody WechatUserDataVO wechatUserDataVO) throws Exception { - return miniUserService.updateDefaultUsernameByData(token, wechatUserDataVO); - } - -} diff --git a/src/main/java/com/cm/serviceusercenter/controller/app/apis/system/user/UserAppController.java b/src/main/java/com/cm/serviceusercenter/controller/app/apis/system/user/UserAppController.java index 7a2442a..9cfb9d7 100644 --- a/src/main/java/com/cm/serviceusercenter/controller/app/apis/system/user/UserAppController.java +++ b/src/main/java/com/cm/serviceusercenter/controller/app/apis/system/user/UserAppController.java @@ -2,7 +2,6 @@ package com.cm.serviceusercenter.controller.app.apis.system.user; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.cm.common.annotation.CheckRequestBodyAnnotation; import com.cm.common.base.AbstractController; import com.cm.common.constants.ISystemConstant; import com.cm.common.exception.ParamsException; @@ -11,17 +10,16 @@ import com.cm.common.exception.UpdateException; import com.cm.common.pojo.ListPage; import com.cm.common.result.ErrorResult; import com.cm.common.result.SuccessResult; -import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.common.token.app.AppTokenManager; import com.cm.common.utils.RegexUtil; -import com.cm.manager.sms.manager.VerificationCodeManager; -import com.cm.manager.sms.pojo.VerificationCode; import com.cm.serviceusercenter.pojo.dtos.DepartmentUserDTO; import com.cm.serviceusercenter.pojo.dtos.UserDTO; import com.cm.serviceusercenter.pojo.dtos.user.UserAppDTO; import com.cm.serviceusercenter.pojo.dtos.user.UserInfoDynamicFieldDTO; -import com.cm.serviceusercenter.pojo.vos.user.*; +import com.cm.serviceusercenter.pojo.vos.user.AppChangePasswordVO; +import com.cm.serviceusercenter.pojo.vos.user.AppChangeUserVO; +import com.cm.serviceusercenter.pojo.vos.user.UserAndDepartmentIdVO; import com.cm.serviceusercenter.service.system.user.IUserService; import io.swagger.annotations.*; import org.apache.commons.lang3.StringUtils; @@ -267,21 +265,6 @@ public class UserAppController extends AbstractController { return userService.getUserInfo(token); } - @ApiOperation(value = "修改手机用户名", notes = "修改手机用户名接口") - @ApiImplicitParams({ - @ApiImplicitParam(name = "token", value = "token", paramType = "header"), - }) - @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) - @PutMapping("updatephoneusername/{phone}") - @CheckRequestBodyAnnotation - public SuccessResultData updatePhoneUsername(@PathVariable("phone") String phone, @RequestBody UpdatePhoneUsernameVO updatePhoneUsernameVO) throws Exception { - if (!RegexUtil.isPhone(phone)) { - throw new ParamsException("手机格式不正确"); - } - VerificationCodeManager.getInstance().checkVerificationCode(phone, updatePhoneUsernameVO.getVerificationCode()); - return userService.updatePhoneUsername(phone, updatePhoneUsernameVO); - } - @ApiOperation(value = "获取APP用户", notes = "获取APP用户接口") @ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", paramType = "header"), @@ -292,18 +275,6 @@ public class UserAppController extends AbstractController { return userService.getAppUser(token); } - @ApiOperation(value = "忘记密码", notes = "忘记密码接口") - @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) - @PutMapping("forgetpassword") - @CheckRequestBodyAnnotation - public SuccessResult forgetPassword(@RequestBody AppForgetPasswordVO appForgetPasswordVO) { - if (!RegexUtil.isPhone(appForgetPasswordVO.getPhone())) { - throw new ParamsException("手机格式不正确"); - } - VerificationCodeManager.getInstance().checkVerificationCode(appForgetPasswordVO.getPhone(), appForgetPasswordVO.getVerificationCode()); - return userService.updateForgetPassword(appForgetPasswordVO); - } - @ApiOperation(value = "下载用户头像", notes = "下载用户头像接口") @ApiImplicitParams({ @ApiImplicitParam(name = "userId", value = "用户Id", paramType = "path") @@ -313,29 +284,4 @@ public class UserAppController extends AbstractController { public void downLoadAvatar(@PathVariable("userId") String userId, HttpServletRequest request, HttpServletResponse response) { userService.downLoadAvatar(userId, request, response); } - - @ApiOperation(value = "更新微信默认用户名", notes = "更新微信默认用户名接口") - @ApiImplicitParams({ - @ApiImplicitParam(name = "token", value = "token", paramType = "header"), - }) - @PutMapping("updatewechatdefaultusername") - @CheckRequestBodyAnnotation - public SuccessResultData updateWechatDefaultUsername(@RequestHeader("token") String token, @RequestBody WechatUpdateDefaultUsernameVO wechatUpdateDefaultUsernameVO) throws Exception { - if (StringUtils.isBlank(wechatUpdateDefaultUsernameVO.getVerificationCode())) { - throw new ParamsException("验证码不能为空"); - } - VerificationCodeManager.getInstance().checkVerificationCode(wechatUpdateDefaultUsernameVO.getPhone(), wechatUpdateDefaultUsernameVO.getVerificationCode()); - return userService.updateWxDefaultUsername(token, wechatUpdateDefaultUsernameVO.getPhone(), 1); - } - - @ApiOperation(value = "更新微信小程序默认用户名", notes = "更新微信小程序默认用户名接口") - @ApiImplicitParams({ - @ApiImplicitParam(name = "token", value = "token", paramType = "header"), - }) - @PutMapping("updateminiappdefaultusername") - @CheckRequestBodyAnnotation - public SuccessResultData updateMiniAppDefaultUsername(@RequestHeader("token") String token, @RequestBody WechatUpdateDefaultUsernameVO wechatUpdateDefaultUsernameVO) throws Exception { - VerificationCodeManager.getInstance().checkVerificationCode(wechatUpdateDefaultUsernameVO.getPhone(), wechatUpdateDefaultUsernameVO.getVerificationCode()); - return userService.updateWxDefaultUsername(token, wechatUpdateDefaultUsernameVO.getPhone(), 2); - } } diff --git a/src/main/java/com/cm/serviceusercenter/controller/dingding/apis/user/DingDingUserController.java b/src/main/java/com/cm/serviceusercenter/controller/dingding/apis/user/DingDingUserController.java deleted file mode 100644 index 2d23816..0000000 --- a/src/main/java/com/cm/serviceusercenter/controller/dingding/apis/user/DingDingUserController.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.cm.serviceusercenter.controller.dingding.apis.user; - -import com.cm.common.constants.ISystemConstant; -import com.cm.common.dingding.config.properties.DingDingAppProperties; -import com.cm.common.exception.base.SystemException; -import com.cm.common.result.ErrorResult; -import com.cm.common.result.SuccessResult; -import com.cm.serviceusercenter.service.system.user.IDingDingUserService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * @ClassName: DingDingUserController - * @Description: 钉钉用户管理 - * @Author: wanggeng - * @Date: 2021/8/12 2:37 下午 - * @Version: 1.0 - */ -@Api(tags = ISystemConstant.API_TAGS_DINGDING_PREFIX + "登录") -@RestController -@RequestMapping(ISystemConstant.DINGDING_PREFIX + "/user") -public class DingDingUserController { - - @Autowired - private IDingDingUserService dingDingUserService; - @Autowired - private DingDingAppProperties dingDingAppProperties; - - @ApiOperation(value = "同步钉钉通讯录", notes = "同步钉钉通讯录接口") - @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) - @PutMapping("update-sync-dingding") - public SuccessResult updateSyncDingDing() throws Exception { - if (dingDingAppProperties == null || !dingDingAppProperties.getActive()) { - throw new SystemException("钉钉未激活"); - } - dingDingUserService.updateSyncDingDing(); - return new SuccessResult(); - } - -} diff --git a/src/main/java/com/cm/serviceusercenter/service/system/user/IDingDingUserService.java b/src/main/java/com/cm/serviceusercenter/service/system/user/IDingDingUserService.java deleted file mode 100644 index ef29dde..0000000 --- a/src/main/java/com/cm/serviceusercenter/service/system/user/IDingDingUserService.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.cm.serviceusercenter.service.system.user; - -import com.taobao.api.ApiException; - -/** - * @ClassName: IDingDingUserService - * @Description: 钉钉用户 - * @Author: wanggeng - * @Date: 2021/8/12 2:49 下午 - * @Version: 1.0 - */ -public interface IDingDingUserService { - /** - * 同步钉钉通讯录,不做删除,只做新增 - */ - void updateSyncDingDing() throws Exception; -} diff --git a/src/main/java/com/cm/serviceusercenter/service/system/user/IMiniUserService.java b/src/main/java/com/cm/serviceusercenter/service/system/user/IMiniUserService.java deleted file mode 100644 index 4353b5d..0000000 --- a/src/main/java/com/cm/serviceusercenter/service/system/user/IMiniUserService.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.cm.serviceusercenter.service.system.user; - -import com.cm.common.result.SuccessResultData; -import com.cm.serviceusercenter.pojo.vos.user.WechatUserDataVO; - -/** - * When you feel like quitting. Think about why you started - * 当你想要放弃的时候,想想当初你为何开始 - * - * @ClassName: IMiniUserService - * @Description: 小程序用户 - * @Author: WangGeng - * @Date: 2020/10/29 18:03 - * @Version: 1.0 - **/ -public interface IMiniUserService { - - /** - * 更新小程序默认用户名 - * - * @param token token - * @param wechatUserDataVO 小程序用户加密数据 - * @return - * @throws Exception - */ - SuccessResultData updateDefaultUsernameByData(String token, WechatUserDataVO wechatUserDataVO) throws Exception; -} diff --git a/src/main/java/com/cm/serviceusercenter/service/system/user/impl/DingDingUserServiceImpl.java b/src/main/java/com/cm/serviceusercenter/service/system/user/impl/DingDingUserServiceImpl.java deleted file mode 100644 index ebc5923..0000000 --- a/src/main/java/com/cm/serviceusercenter/service/system/user/impl/DingDingUserServiceImpl.java +++ /dev/null @@ -1,212 +0,0 @@ -package com.cm.serviceusercenter.service.system.user.impl; - -import com.cm.common.base.AbstractService; -import com.cm.common.dingding.pojo.pos.DingDingDepartmentPO; -import com.cm.common.dingding.pojo.pos.DingDingUserPO; -import com.cm.common.dingding.pojo.vos.DingDingDepartmentVO; -import com.cm.common.dingding.pojo.vos.DingDingUserVO; -import com.cm.common.dingding.service.IDingDingAppDepartmentService; -import com.cm.common.dingding.service.IDingDingAppUserService; -import com.cm.serviceusercenter.pojo.dtos.DepartmentUserDTO; -import com.cm.serviceusercenter.pojo.dtos.UserDTO; -import com.cm.serviceusercenter.pojo.dtos.department.DepartmentSimpleDTO; -import com.cm.serviceusercenter.pojo.vos.DepartmentVO; -import com.cm.serviceusercenter.pojo.vos.UserVO; -import com.cm.serviceusercenter.service.system.department.IDepartmentService; -import com.cm.serviceusercenter.service.system.user.IDingDingUserService; -import com.cm.serviceusercenter.service.system.user.IUserService; -import com.dingtalk.api.response.OapiV2DepartmentListsubResponse; -import com.dingtalk.api.response.OapiV2UserListResponse; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - * @ClassName: DingDingUserServiceImpl - * @Description: 钉钉用户管理 - * @Author: wanggeng - * @Date: 2021/8/12 2:49 下午 - * @Version: 1.0 - */ -@Service -public class DingDingUserServiceImpl extends AbstractService implements IDingDingUserService { - - @Autowired - private IDingDingAppUserService dingDingAppUserService; - @Autowired - private IDingDingAppDepartmentService dingDingAppDepartmentService; - @Autowired - private IDepartmentService departmentService; - @Autowired - private IUserService userService; - - @Override - public void updateSyncDingDing() throws Exception { - // 构建绑定的部门 - LOG.debug("同步钉钉部门关系"); - List bindDingDingDepartmentVOs = new ArrayList<>(); - // 添加根节点 - DingDingDepartmentVO rootDingDingDepartmentVO = new DingDingDepartmentVO(); - rootDingDingDepartmentVO.setDingdingDepartmentId(1L); - rootDingDingDepartmentVO.setDingdingDepartmentParentId(0L); - bindDingDingDepartmentVOs.add(rootDingDingDepartmentVO); - departmentSync(1L, "0", bindDingDingDepartmentVOs); - if (bindDingDingDepartmentVOs.isEmpty()) { - return; - } - // 保存部门绑定关系 - for (DingDingDepartmentVO dingDingDepartmentVO : bindDingDingDepartmentVOs) { - if (dingDingDepartmentVO.getDingdingDepartmentId() == 1L) { - continue; - } - LOG.debug("保存部门:{}", dingDingDepartmentVO.getDepartmentName()); - dingDingAppDepartmentService.save(dingDingDepartmentVO); - } - LOG.debug("同步钉钉用户"); - Map params = getHashMap(0); - List userDTOs = userService.listUsers(params); - List dingDingUserVOs = new ArrayList<>(); - syncUser(bindDingDingDepartmentVOs, userDTOs, dingDingUserVOs); - if (dingDingUserVOs.isEmpty()) { - return; - } - // 绑定钉钉用户与系统用户关系 - for (DingDingUserVO dingDingUserVO : dingDingUserVOs) { - LOG.debug("保存用户:{} - {}", dingDingUserVO.getMobile(), dingDingUserVO.getName()); - dingDingAppUserService.save(dingDingUserVO); - LOG.debug("保存用户与部门关系"); - String[] deptIdArray = dingDingUserVO.getDeptIdList().split(","); - for (String deptId : deptIdArray) { - for (DingDingDepartmentVO dingDingDepartmentVO : bindDingDingDepartmentVOs) { - if (StringUtils.isEmpty(dingDingDepartmentVO.getDepartmentId())) { - continue; - } - if (Long.valueOf(deptId).equals(dingDingDepartmentVO.getDingdingDepartmentId())) { - DepartmentUserDTO departmentUserDTO = userService.getDepartmentUser(dingDingDepartmentVO.getDepartmentId(), dingDingUserVO.getUserId()); - if (departmentUserDTO != null) { - continue; - } - userService.saveDepartmentUser(dingDingDepartmentVO.getDepartmentId(), dingDingUserVO.getUserId()); - } - } - } - } - } - - /** - * 同步部门 - * - * @param dingDingParentId - * @param departmentParentId - * @param bindDingDingDepartmentVOs - * @throws Exception - */ - public void departmentSync(Long dingDingParentId, - String departmentParentId, - List bindDingDingDepartmentVOs) throws Exception { - List deptBaseResponses = dingDingAppDepartmentService.list(dingDingParentId); - if (deptBaseResponses == null || deptBaseResponses.isEmpty()) { - return; - } - List departmentSimpleDTOs = departmentService.listDepartmentSimpleByParentId(departmentParentId); - for (OapiV2DepartmentListsubResponse.DeptBaseResponse deptBaseResponse : deptBaseResponses) { - // 未绑定过 - DingDingDepartmentPO dingDingDepartmentPO = dingDingAppDepartmentService.getPO(deptBaseResponse.getDeptId()); - if (dingDingDepartmentPO != null) { - continue; - } - boolean isDepartmentExist = false; - DingDingDepartmentVO dingDingDepartmentVO = new DingDingDepartmentVO(); - dingDingDepartmentVO.setDingdingDepartmentId(deptBaseResponse.getDeptId()); - dingDingDepartmentVO.setDingdingDepartmentParentId(deptBaseResponse.getParentId()); - dingDingDepartmentVO.setDepartmentName(deptBaseResponse.getName()); - // 同步内容 - for (DepartmentSimpleDTO departmentSimpleDTO : departmentSimpleDTOs) { - if (StringUtils.equals(deptBaseResponse.getName(), departmentSimpleDTO.getDepartmentName())) { - isDepartmentExist = true; - dingDingDepartmentVO.setDepartmentId(departmentSimpleDTO.getDepartmentId()); - dingDingDepartmentVO.setDepartmentParentId(departmentSimpleDTO.getDepartmentParentId()); - break; - } - } - if (!isDepartmentExist) { - DepartmentVO departmentVO = new DepartmentVO(); - departmentVO.setDepartmentState(1); - departmentVO.setDepartmentType(1); - departmentVO.setDepartmentName(deptBaseResponse.getName()); - departmentVO.setDepartmentSummary("钉钉同步"); - departmentVO.setDepartmentParentId(departmentParentId); - String departmentId = departmentService.saveDepartmentReturnId(departmentVO); - // 填充信息 - dingDingDepartmentVO.setDepartmentId(departmentId); - dingDingDepartmentVO.setDepartmentParentId(departmentParentId); - } - // 递归同步 - departmentSync(deptBaseResponse.getDeptId(), dingDingDepartmentVO.getDepartmentId(), bindDingDingDepartmentVOs); - bindDingDingDepartmentVOs.add(dingDingDepartmentVO); - } - } - - /** - * 同步用户 - * - * @param bindDingDingDepartmentVOs - * @param userDTOs - * @param bindDingDingUserVOs - * @throws Exception - */ - private void syncUser(List bindDingDingDepartmentVOs, List userDTOs, List bindDingDingUserVOs) throws Exception { - // 部门用户 - for (DingDingDepartmentVO dingDingDepartmentVO : bindDingDingDepartmentVOs) { - // 钉钉用户列表 - List userResponses = dingDingAppUserService.listByDeptId(dingDingDepartmentVO.getDingdingDepartmentId()); - if (userResponses.isEmpty()) { - continue; - } - for (OapiV2UserListResponse.ListUserResponse userResponse : userResponses) { - DingDingUserPO dingDingUserPO = dingDingAppUserService.getPO(userResponse.getUserid()); - if (dingDingUserPO != null) { - continue; - } - boolean isUserExist = false; - DingDingUserVO dingDingUserVO = new DingDingUserVO(); - dingDingUserVO.setDingdingUserId(userResponse.getUserid()); - dingDingUserVO.setUnionid(userResponse.getUnionid()); - dingDingUserVO.setName(userResponse.getName()); - dingDingUserVO.setMobile(userResponse.getMobile()); - String deptIdListString = ""; - for (Long deptId : userResponse.getDeptIdList()) { - if (!deptIdListString.isEmpty()) { - deptIdListString += ","; - } - deptIdListString += deptId; - } - dingDingUserVO.setDeptIdList(deptIdListString); - for (UserDTO userDTO : userDTOs) { - if (StringUtils.equals(userResponse.getMobile(), userDTO.getUserUsername())) { - isUserExist = true; - dingDingUserVO.setUserId(userDTO.getUserId()); - break; - } - } - if (!isUserExist) { - UserVO userVO = new UserVO(); - userVO.setUserName(userResponse.getName()); - userVO.setUserUsername(userResponse.getMobile()); - userVO.setUserState(0); - userVO.setUserType(2); - userVO.setUserPhone(userResponse.getMobile()); - userVO.setUserEmail(userResponse.getEmail()); - String userId = userService.saveUserReturnId(userVO); - dingDingUserVO.setUserId(userId); - } - bindDingDingUserVOs.add(dingDingUserVO); - } - } - } - -} diff --git a/src/main/java/com/cm/serviceusercenter/service/system/user/impl/MiniUserServiceImpl.java b/src/main/java/com/cm/serviceusercenter/service/system/user/impl/MiniUserServiceImpl.java deleted file mode 100644 index 110f393..0000000 --- a/src/main/java/com/cm/serviceusercenter/service/system/user/impl/MiniUserServiceImpl.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.cm.serviceusercenter.service.system.user.impl; - -import com.alibaba.fastjson.JSONObject; -import com.cm.common.exception.SearchException; -import com.cm.common.result.SuccessResultData; -import com.cm.common.utils.AesUtil; -import com.cm.common.wechat.manager.miniapp.WechatMiniAppManager; -import com.cm.common.wechat.pojo.WechatMiniAppUserInfo; -import com.cm.common.wechat.pojo.WechatMiniAppUserInfoDetail; -import com.cm.serviceusercenter.pojo.vos.user.WechatUserDataVO; -import com.cm.serviceusercenter.service.BaseService; -import com.cm.serviceusercenter.service.system.user.IMiniUserService; -import com.cm.serviceusercenter.service.system.user.IUserService; -import org.apache.commons.codec.binary.Base64; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * When you feel like quitting. Think about why you started - * 当你想要放弃的时候,想想当初你为何开始 - * - * @ClassName: MiniUserServiceImpl - * @Description: 小程序用户管理 - * @Author: WangGeng - * @Date: 2020/10/29 18:03 - * @Version: 1.0 - **/ -@Service -public class MiniUserServiceImpl extends BaseService implements IMiniUserService { - - @Autowired - private IUserService userService; - - @Override - public SuccessResultData updateDefaultUsernameByData(String token, WechatUserDataVO wechatUserDataVO) throws Exception { - WechatMiniAppUserInfo wechatMiniAppUserInfo = WechatMiniAppManager.getInstance().getWechatMiniAppUserInfoByToken(token); - if (wechatMiniAppUserInfo == null) { - throw new SearchException("用户未登录,请重新打开小程序"); - } - byte[] encryptedBytes = Base64.decodeBase64(wechatUserDataVO.getEncryptedData()); - byte[] keyBytes = Base64.decodeBase64(wechatMiniAppUserInfo.getSession_key()); - byte[] ivBytes = Base64.decodeBase64(wechatUserDataVO.getIv()); - byte[] userInfoBytes = AesUtil.aesCommonDecoderDetail(keyBytes, encryptedBytes, ivBytes, AesUtil.PKCS_7); - WechatMiniAppUserInfoDetail wechatMiniAppUserInfoDetail = JSONObject.parseObject(userInfoBytes, WechatMiniAppUserInfoDetail.class); - return userService.updateWxDefaultUsername(token, wechatMiniAppUserInfoDetail.getPurePhoneNumber(), 2); - } - -} diff --git a/src/main/resources/application-btgxq.yml b/src/main/resources/application-btgxq.yml deleted file mode 100644 index fa76cb9..0000000 --- a/src/main/resources/application-btgxq.yml +++ /dev/null @@ -1,167 +0,0 @@ -server: - port: 7021 - url: http://192.168.0.103:7021/usercenter - ws: ws://192.168.0.103:7021/usercenter/ws - title: 统一用户管理平台 - login-page-name: 统一用户管理平台 - default-home-page: index-gxq - servlet: - context-path: /usercenter - -spring: - login-url: /oauth/login - login-failure: /oauth/login?error - login-process: /userlogin - assets-matchers: /assets/** - thymeleaf: - prefix: classpath:/templates/ - suffix: .html - mode: HTML5 - encoding: UTF-8 - cache: false - main: - allow-bean-definition-overriding: true - application: - name: sso-server - servlet: - multipart: - max-file-size: 1GB - max-request-size: 1GB - datasource: - druid: - url: jdbc:mysql://127.0.0.1:3306/db_btgxq_usercenter?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC - db-type: mysql - driver-class-name: com.mysql.cj.jdbc.Driver - username: root - password: root - initial-size: 2 - min-idle: 2 - max-active: 10 - # 配置获取连接等待超时的时间 - max-wait: 60000 - # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 - time-between-eviction-runs-millis: 60000 - # 配置一个连接在池中最小生存的时间,单位是毫秒 - min-evictable-idle-time-millis: 300000 - validation-query: SELECT 1 FROM DUAL - test-while-idle: true - test-on-borrow: false - test-on-return: false - # 打开PSCache,并且指定每个连接上PSCache的大小 - pool-prepared-statements: true - max-pool-prepared-statement-per-connection-size: 10 - # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 - filter: - commons-log: - connection-logger-name: stat,wall,log4j - stat: - log-slow-sql: true - slow-sql-millis: 2000 - # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 - connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 - # 合并多个DruidDataSource的监控数据 - use-global-data-source-stat: true - -mybatis: - config-location: classpath:mybatis/mybatis-config.xml - mapper-locations: classpath*:mybatis/mapper/**/*.xml - -management: - endpoints: - web: - exposure: - include: '*' - enabled-by-default: true - endpoint: - health: - show-details: always - -oauthClient: - clientId: 4995b2989c274e76917a8c6144d4ab3b - clientSecret: ektSeDMwekFDZzl0WnpFQ0ZKZGo1T3NHZkpwODNsdHpmbGU0KzVheHVTQW1ac2wwZTJHWk5NbXh3L3h3U2c4Rg== - -swagger: - title: 接口文档 - description: 用户相关接口文档 - service-url: http://www.wgink.ink - version: 1.0 - swagger-base-package: com.cm - -file: - uploadPath: /Users/wanggeng/Desktop/UploadFiles/ - imageTypes: png,jpg,jpeg,gif,blob - videoTypes: mp4,rmvb - audioTypes: mp3,wmv - fileTypes: doc,docx,xls,xlsx,ppt,pptx,txt,zip,rar,apk,pdf - maxFileCount: 6 - -# 访问控制 -access-control: - pass-paths: - - /index.html - - /logout.html - - /default.html - - /assets/** - - /api/oauthclient/listoauthclient - - /api/oauthclient/countoauthclient - - /api/user/countuser - - /api/file/uploadfile - save-paths: - - /save*/** - - /add*/** - delete-paths: - - /delete*/** - - /remove*/** - update-paths: - - /update*/** - - /edit*/** - query-paths: - - /get*/** - - /query*/** - - /find*/** - - /list*/** - - /count*/** - -logging: - file: /Users/wanggeng/Desktop/UploadFiles/usercenter/serviceuser-logs.log - level: - root: error - com.cm: debug - -# 短信服务 -sms: - active: true - type: default - default-sms: - account: xd001382 - password: xd001382136 - sign: 【腾狮科技】 - template: - verification-code: '{sign} 您的验证码为 {content}, 有效时间为120秒,若非本人操作,请忽略。' - -# 邮件服务 -email: - active: true - smtp: smtp.qq.com - port: 587 - sender-email: 450292408@qq.com - sender-password: pezxpunlxzqgbhhd - cc-persons: - - 450292408@qq.com - - 76158045@qq.com - -socket: - central-control: - active: false - server: - port: 8888 - # 最大连接数 - so-backlog: 1024 - # 服务端超时断连(秒) - read-idle-time-second: 10 - # 离线通知时间(分钟),默认10分钟 - offline-notice-minute: 10 - # 离线通知次数 - offline-notice-count: 3 - # 异常通知最大值 - exception-notice-count: 10 \ No newline at end of file diff --git a/src/main/resources/application-btyj.yml b/src/main/resources/application-btyj.yml deleted file mode 100644 index fea97bd..0000000 --- a/src/main/resources/application-btyj.yml +++ /dev/null @@ -1,168 +0,0 @@ -server: - port: 7011 - url: http://1.180.60.42:8084/usercenter - ws: ws://1.180.60.42:8084/usercenter/ws - title: 统一用户管理平台 - login-page-name: 统一用户管理平台 - servlet: - context-path: /usercenter - -spring: - login-url: /oauth/login - login-failure: /oauth/login?error - login-process: /userlogin - assets-matchers: /assets/** - thymeleaf: - prefix: classpath:/templates/ - suffix: .html - mode: HTML5 - encoding: UTF-8 - cache: false - main: - allow-bean-definition-overriding: true - application: - name: sso-server - servlet: - multipart: - max-file-size: 1GB - max-request-size: 1GB - datasource: - druid: - # url: jdbc:mysql://127.0.0.1:3306/db_cloud_v2_test?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC - url: jdbc:mysql://127.0.0.1:3306/db_btyjj_usercenter1?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC - db-type: mysql - driver-class-name: com.mysql.cj.jdbc.Driver - username: root -# password: TSkj@0471.123 - password: root - initial-size: 2 - min-idle: 2 - max-active: 10 - # 配置获取连接等待超时的时间 - max-wait: 60000 - # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 - time-between-eviction-runs-millis: 60000 - # 配置一个连接在池中最小生存的时间,单位是毫秒 - min-evictable-idle-time-millis: 300000 - validation-query: SELECT 1 FROM DUAL - test-while-idle: true - test-on-borrow: false - test-on-return: false - # 打开PSCache,并且指定每个连接上PSCache的大小 - pool-prepared-statements: true - max-pool-prepared-statement-per-connection-size: 10 - # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 - filter: - commons-log: - connection-logger-name: stat,wall,log4j - stat: - log-slow-sql: true - slow-sql-millis: 2000 - # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 - connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 - # 合并多个DruidDataSource的监控数据 - use-global-data-source-stat: true - -mybatis: - config-location: classpath:mybatis/mybatis-config.xml - mapper-locations: classpath*:mybatis/mapper/**/*.xml - -management: - endpoints: - web: - exposure: - include: '*' - enabled-by-default: true - endpoint: - health: - show-details: always - -oauthClient: - clientId: 4995b2989c274e76917a8c6144d4ab3b - clientSecret: ektSeDMwekFDZzl0WnpFQ0ZKZGo1T3NHZkpwODNsdHpmbGU0KzVheHVTQW1ac2wwZTJHWk5NbXh3L3h3U2c4Rg== - -swagger: - title: 接口文档 - description: 用户相关接口文档 - service-url: http://www.wgink.ink - version: 1.0 - swagger-base-package: com.cm - -file: - uploadPath: /root/projects_test/uploadFiles/ - imageTypes: png,jpg,jpeg,gif,blob - videoTypes: mp4,rmvb - audioTypes: mp3,wmv - fileTypes: doc,docx,xls,xlsx,ppt,pptx,txt,zip,rar,apk,pdf - maxFileCount: 6 - -# 访问控制 -access-control: - pass-paths: - - /index.html - - /logout.html - - /default.html - - /assets/** - - /api/oauthclient/listoauthclient - - /api/oauthclient/countoauthclient - - /api/user/countuser - - /api/file/uploadfile - save-paths: - - /save*/** - - /add*/** - delete-paths: - - /delete*/** - - /remove*/** - update-paths: - - /update*/** - - /edit*/** - query-paths: - - /get*/** - - /query*/** - - /find*/** - - /list*/** - - /count*/** - -logging: - file: /root/projects_test/logs/usercenter/serviceuser-logs.log - level: - root: error - com.cm: debug - -# 短信服务 -sms: - active: true - type: default - default-sms: - account: xd001382 - password: xd001382136 - sign: 【腾狮科技】 - template: - verification-code: '{sign} 您的验证码为 {content}, 有效时间为120秒,若非本人操作,请忽略。' - -# 邮件服务 -email: - active: true - smtp: smtp.qq.com - port: 587 - sender-email: 450292408@qq.com - sender-password: pezxpunlxzqgbhhd - cc-persons: - - 450292408@qq.com - - 76158045@qq.com - -socket: - central-control: - active: false - server: - port: 8888 - # 最大连接数 - so-backlog: 1024 - # 服务端超时断连(秒) - read-idle-time-second: 10 - # 离线通知时间(分钟),默认10分钟 - offline-notice-minute: 10 - # 离线通知次数 - offline-notice-count: 3 - # 异常通知最大值 - exception-notice-count: 10 \ No newline at end of file diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml deleted file mode 100644 index 8a16923..0000000 --- a/src/main/resources/application-dev.yml +++ /dev/null @@ -1,239 +0,0 @@ -server: - port: 7001 - url: http://192.168.0.152:7001/usercenter - title: 统一用户管理平台 - login-page-name: 统一用户管理平台 - servlet: - context-path: /usercenter - -spring: - login-url: /oauth/login - login-failure: /oauth/login?error - login-process: /userlogin - assets-matchers: /assets/** - thymeleaf: - prefix: classpath:/templates/ - suffix: .html - mode: HTML5 - encoding: UTF-8 - cache: false - main: - allow-bean-definition-overriding: true - application: - name: sso-server - servlet: - multipart: - max-file-size: 1GB - max-request-size: 1GB - datasource: - druid: - url: jdbc:mysql://192.168.0.151:3306/db_cloud?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC - db-type: mysql - driver-class-name: com.mysql.cj.jdbc.Driver - username: root - password: root - initial-size: 2 - min-idle: 2 - max-active: 10 - # 配置获取连接等待超时的时间 - max-wait: 60000 - # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 - time-between-eviction-runs-millis: 60000 - # 配置一个连接在池中最小生存的时间,单位是毫秒 - min-evictable-idle-time-millis: 300000 - validation-query: SELECT 1 FROM DUAL - test-while-idle: true - test-on-borrow: false - test-on-return: false - # 打开PSCache,并且指定每个连接上PSCache的大小 - pool-prepared-statements: true - max-pool-prepared-statement-per-connection-size: 10 - # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 - filter: - commons-log: - connection-logger-name: stat,wall,log4j - stat: - log-slow-sql: true - slow-sql-millis: 2000 - # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 - connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 - # 合并多个DruidDataSource的监控数据 - use-global-data-source-stat: true - -mybatis: - config-location: classpath:mybatis/mybatis-config.xml - mapper-locations: classpath*:mybatis/mapper/**/*.xml - -management: - endpoints: - web: - enabled: true - exposure: - include: '*' - base-path: /manage - enabled-by-default: true - endpoint: - env: - enabled: true - health: - show-details: always - -# 用户,非必填 -user: - # 默认密码 - default-password: 88888888 - -oauthClient: - clientId: 4995b2989c274e76917a8c6144d4ab3b - clientSecret: ektSeDMwekFDZzl0WnpFQ0ZKZGo1T3NHZkpwODNsdHpmbGU0KzVheHVTQW1ac2wwZTJHWk5NbXh3L3h3U2c4Rg== - -swagger: - title: 接口文档 - description: 用户相关接口文档 - service-url: https://baidu.com/ - version: 1.0 - swagger-base-package: com.cm - -file: - uploadPath: /projects/uploadFiles/ - imageTypes: png,jpg,jpeg,gif,blob - videoTypes: mp4,rmvb - audioTypes: mp3,wmv - fileTypes: doc,docx,xls,xlsx,ppt,pptx,txt,zip,rar,apk,pdf - maxFileCount: 6 - -# 访问控制 -access-control: - pass-paths: - - /index.html - - /logout.html - - /default.html - - /assets/** - - /web/** - - /api/oauthclient/listoauthclient - - /api/oauthclient/countoauthclient - - /api/user/countuser - - /api/file/uploadfile - save-paths: - - /save*/** - - /add*/** - delete-paths: - - /delete*/** - - /remove*/** - update-paths: - - /update*/** - - /edit*/** - query-paths: - - /get*/** - - /query*/** - - /find*/** - - /list*/** - - /count*/** - -logging: - file: /projects/logs/usercenter/serviceuser-logs.log - level: - root: error - com.cm: debug - -# 短信服务 -sms: - active: false - type: default - default-sms: - account: xd001382 - password: xd001382136 - sign: 【日喀则文化馆】 - template: - verification-code: '{sign} 您的验证码为 {content}, 有效时间为120秒,若非本人操作,请忽略。' - -open-platform: - # 钉钉 - dingding: - # 扫码登陆,通过扫码拿到用户unionid,通过access_token获取个人信息,需要设置钉钉通讯录权限,设置访问白名单 - scan-code-login: - app-id: dingoaorwac5cel8rt57rz - app-secret: j5n_xRR5eiWGWdNSr3z1UNtGnSRxb1sLp2aKHofwiUuxT8cnJRc46bXTCDBe2t_x - userinfo-url: https://oapi.dingtalk.com/sns/getuserinfo_bycode - # 必须有一个APP来辅助钉钉扫码登陆 - app: - active: false - agent-id: 295981340 - app-key: dingxz2jzohb7dft9iw7 - app-secret: MWjSN1PUML-tCjgiSCOUR62Fs_-bdJSaHcorWhLZsd6pKTw6YL-USdsW87QWLxd6 - token-url: https://oapi.dingtalk.com/gettoken - userid-by-unionid-url: https://oapi.dingtalk.com/user/getUseridByUnionid - userinfo-by-id-url: https://oapi.dingtalk.com/user/get - # 微信 - wechat: - mini-app: - # 激活状态 - active: false - authorizeUrl: https://api.weixin.qq.com/sns/jscode2session - # 绑定用户连接,指向统一用户,可以内网 - bindUserUrl: http://127.0.0.1:7001/usercenter/wxminiapp/sign/logincheckusername - grantType: authorization_code -# appKey: wxe17874894f7ff27b -# appSecret: 9ab6a87ccedf6555809f1a42e3820f12 -# appKey: wx953da91650b16128 -# appSecret: 69ba0f0223da28e1472a9fe33b4c34d7 - appKey: wxc529578602bca580 - appSecret: fb752f8eed90ed449e7194c82756bb7f - # 公众号 - official-account: - # 开启跨域 - apiCrossOrigin: false - activate: false - authorize: - authorize-url: https://open.weixin.qq.com/connect/oauth2/authorize - access-token-url: https://api.weixin.qq.com/sns/oauth2/access_token - access-token-refresh-url: https://api.weixin.qq.com/sns/oauth2/refresh_token - userinfo-url: https://api.weixin.qq.com/sns/userinfo - response-type: code - scope: snsapi_userinfo - state: wechatRedirectUrl - grant-type: authorization_code - access-token-url: https://api.weixin.qq.com/cgi-bin/token - bind-user-url: http://192.168.0.113:7001/usercenter/wechat/sign/login - app-id: wx583634d14c596fd7 - app-secret: 1158dcddd267c6f42b99bda62f842893 - grant-type: client_credential - config-token: WenG - -# 邮件服务 -email: - active: false - smtp: smtp.163.com - port: 25 - sender-email: dpdbd001@163.com - sender-password: WAASUQNNVITVXDJS - cc-persons: - - 450292408@qq.com - - 76158045@qq.com - -socket: - central-control: - active: true - server: - port: 7888 - # 最大连接数 - so-backlog: 1024 - # 服务端超时断连(秒) - read-idle-time-second: 10 - # 离线通知时间(分钟),默认10分钟 - offline-notice-minute: 1 - # 离线通知次数 - offline-notice-count: 3 - # 异常通知最大值 - exception-notice-count: 10 - client: - client-id: 317dce24-79cb-41c4-9d59-8b7eaa146eb1 - client-secret: DpLh+yC8k6JwVEqsf+DCelvvIKlYd6HO60EH8hUdiWuANOlRunYMCMoUsGr0Gqh3 - host: 49.233.36.36 - port: 8888 - max-reconnect-count: 20 - reconnect-time-step: 1 - delay-ping-seconds: 3 - send-client-info-active: false - # 上报服务器数据时间 - send-client-info-second: 30 diff --git a/src/main/resources/application-jnhb.yml b/src/main/resources/application-jnhb.yml deleted file mode 100644 index abc43a2..0000000 --- a/src/main/resources/application-jnhb.yml +++ /dev/null @@ -1,240 +0,0 @@ -server: - port: 7001 - url: http://106.12.218.237:8001/usercenter - ws: ws://106.12.218.237:8001/usercenter/ws - title: 统一用户管理平台 - login-page-name: 统一用户管理平台 - servlet: - context-path: /usercenter - -spring: - login-url: /oauth/login - login-failure: /oauth/login?error - login-process: /userlogin - assets-matchers: /assets/** - thymeleaf: - prefix: classpath:/templates/ - suffix: .html - mode: HTML5 - encoding: UTF-8 - cache: false - main: - allow-bean-definition-overriding: true - application: - name: sso-server - servlet: - multipart: - max-file-size: 1GB - max-request-size: 1GB - datasource: - druid: - url: jdbc:mysql://localhost:8668/db_cloud_v2?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC - db-type: mysql - driver-class-name: com.mysql.cj.jdbc.Driver - username: root - password: TSkj@0471.123 - initial-size: 2 - min-idle: 2 - max-active: 10 - # 配置获取连接等待超时的时间 - max-wait: 60000 - # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 - time-between-eviction-runs-millis: 60000 - # 配置一个连接在池中最小生存的时间,单位是毫秒 - min-evictable-idle-time-millis: 300000 - validation-query: SELECT 1 FROM DUAL - test-while-idle: true - test-on-borrow: false - test-on-return: false - # 打开PSCache,并且指定每个连接上PSCache的大小 - pool-prepared-statements: true - max-pool-prepared-statement-per-connection-size: 10 - # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 - filter: - commons-log: - connection-logger-name: stat,wall,log4j - stat: - log-slow-sql: true - slow-sql-millis: 2000 - # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 - connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 - # 合并多个DruidDataSource的监控数据 - use-global-data-source-stat: true - -mybatis: - config-location: classpath:mybatis/mybatis-config.xml - mapper-locations: classpath*:mybatis/mapper/**/*.xml - -management: - endpoints: - web: - enabled: true - exposure: - include: '*' - base-path: /manage - enabled-by-default: true - endpoint: - env: - enabled: true - health: - show-details: always - -# 用户,非必填 -user: - # 默认密码 - default-password: 88888888 - -oauthClient: - clientId: 4995b2989c274e76917a8c6144d4ab3b - clientSecret: ektSeDMwekFDZzl0WnpFQ0ZKZGo1T3NHZkpwODNsdHpmbGU0KzVheHVTQW1ac2wwZTJHWk5NbXh3L3h3U2c4Rg== - -swagger: - title: 接口文档 - description: 用户相关接口文档 - service-url: https://106.12.218.237:8001/ - version: 1.0 - swagger-base-package: com.cm - -file: - uploadPath: /projects/uploadFiles/ - imageTypes: png,jpg,jpeg,gif,blob - videoTypes: mp4,rmvb - audioTypes: mp3,wmv - fileTypes: doc,docx,xls,xlsx,ppt,pptx,txt,zip,rar,apk,pdf - maxFileCount: 6 - -# 访问控制 -access-control: - pass-paths: - - /index.html - - /logout.html - - /default.html - - /assets/** - - /web/** - - /api/oauthclient/listoauthclient - - /api/oauthclient/countoauthclient - - /api/user/countuser - - /api/file/uploadfile - save-paths: - - /save*/** - - /add*/** - delete-paths: - - /delete*/** - - /remove*/** - update-paths: - - /update*/** - - /edit*/** - query-paths: - - /get*/** - - /query*/** - - /find*/** - - /list*/** - - /count*/** - -logging: - file: /projects/logs/usercenter/logs.log - level: - root: error - com.cm: debug - -# 短信服务 -sms: - active: false - type: default - default-sms: - account: xd001382 - password: xd001382136 - sign: 【日喀则文化馆】 - template: - verification-code: '{sign} 您的验证码为 {content}, 有效时间为120秒,若非本人操作,请忽略。' - -open-platform: - # 钉钉 - dingding: - # 扫码登陆,通过扫码拿到用户unionid,通过access_token获取个人信息,需要设置钉钉通讯录权限,设置访问白名单 - scan-code-login: - app-id: dingoaorwac5cel8rt57rz - app-secret: j5n_xRR5eiWGWdNSr3z1UNtGnSRxb1sLp2aKHofwiUuxT8cnJRc46bXTCDBe2t_x - userinfo-url: https://oapi.dingtalk.com/sns/getuserinfo_bycode - # 必须有一个APP来辅助钉钉扫码登陆 - app: - active: false - agent-id: 295981340 - app-key: dingxz2jzohb7dft9iw7 - app-secret: MWjSN1PUML-tCjgiSCOUR62Fs_-bdJSaHcorWhLZsd6pKTw6YL-USdsW87QWLxd6 - token-url: https://oapi.dingtalk.com/gettoken - userid-by-unionid-url: https://oapi.dingtalk.com/user/getUseridByUnionid - userinfo-by-id-url: https://oapi.dingtalk.com/user/get - # 微信 - wechat: - mini-app: - # 激活状态 - active: false - authorizeUrl: https://api.weixin.qq.com/sns/jscode2session - # 绑定用户连接,指向统一用户,可以内网 - bindUserUrl: http://127.0.0.1:7001/usercenter/wxminiapp/sign/logincheckusername - grantType: authorization_code - # appKey: wxe17874894f7ff27b - # appSecret: 9ab6a87ccedf6555809f1a42e3820f12 - # appKey: wx953da91650b16128 - # appSecret: 69ba0f0223da28e1472a9fe33b4c34d7 - appKey: wxc529578602bca580 - appSecret: fb752f8eed90ed449e7194c82756bb7f - # 公众号 - official-account: - # 开启跨域 - apiCrossOrigin: false - activate: false - authorize: - authorize-url: https://open.weixin.qq.com/connect/oauth2/authorize - access-token-url: https://api.weixin.qq.com/sns/oauth2/access_token - access-token-refresh-url: https://api.weixin.qq.com/sns/oauth2/refresh_token - userinfo-url: https://api.weixin.qq.com/sns/userinfo - response-type: code - scope: snsapi_userinfo - state: wechatRedirectUrl - grant-type: authorization_code - access-token-url: https://api.weixin.qq.com/cgi-bin/token - bind-user-url: http://192.168.0.113:7001/usercenter/wechat/sign/login - app-id: wx583634d14c596fd7 - app-secret: 1158dcddd267c6f42b99bda62f842893 - grant-type: client_credential - config-token: WenG - -# 邮件服务 -email: - active: false - smtp: smtp.163.com - port: 25 - sender-email: dpdbd001@163.com - sender-password: WAASUQNNVITVXDJS - cc-persons: - - 450292408@qq.com - - 76158045@qq.com - -socket: - central-control: - active: false - server: - port: 7888 - # 最大连接数 - so-backlog: 1024 - # 服务端超时断连(秒) - read-idle-time-second: 10 - # 离线通知时间(分钟),默认10分钟 - offline-notice-minute: 1 - # 离线通知次数 - offline-notice-count: 3 - # 异常通知最大值 - exception-notice-count: 10 - client: - client-id: 317dce24-79cb-41c4-9d59-8b7eaa146eb1 - client-secret: DpLh+yC8k6JwVEqsf+DCelvvIKlYd6HO60EH8hUdiWuANOlRunYMCMoUsGr0Gqh3 - host: 49.233.36.36 - port: 8888 - max-reconnect-count: 20 - reconnect-time-step: 1 - delay-ping-seconds: 3 - send-client-info-active: false - # 上报服务器数据时间 - send-client-info-second: 30 From b47f55f9b63f1ab8fd03e3ad5196ebd096ad20fd Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Tue, 6 Sep 2022 11:54:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A4=84=E7=90=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 26 ---- src/main/resources/application-btyj.yml | 128 ++++++++++++++++++ src/main/resources/application-prod.yml | 60 +------- src/main/resources/application-test.yml | 107 +-------------- .../route/system/user/save-department.html | 3 - 5 files changed, 136 insertions(+), 188 deletions(-) create mode 100644 src/main/resources/application-btyj.yml diff --git a/pom.xml b/pom.xml index c4518a1..b5306ac 100644 --- a/pom.xml +++ b/pom.xml @@ -95,24 +95,6 @@ provided - - - - - - - - - - - - - - - - - - org.apache.xmlbeans xmlbeans @@ -120,14 +102,6 @@ compile - - - - - - - - diff --git a/src/main/resources/application-btyj.yml b/src/main/resources/application-btyj.yml new file mode 100644 index 0000000..eee4388 --- /dev/null +++ b/src/main/resources/application-btyj.yml @@ -0,0 +1,128 @@ +server: + port: 7011 + url: http://1.180.60.42:8084/usercenter + ws: ws://1.180.60.42:8084/usercenter/ws + title: 统一用户管理平台 + login-page-name: 统一用户管理平台 + servlet: + context-path: /usercenter + +spring: + login-url: /oauth/login + login-failure: /oauth/login?error + login-process: /userlogin + assets-matchers: /assets/** + thymeleaf: + prefix: classpath:/templates/ + suffix: .html + mode: HTML5 + encoding: UTF-8 + cache: false + main: + allow-bean-definition-overriding: true + application: + name: sso-server + servlet: + multipart: + max-file-size: 1GB + max-request-size: 1GB + datasource: + druid: + url: jdbc:mysql://127.0.0.1:3306/db_cloud_usercenter_v2?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC + db-type: mysql + driver-class-name: com.mysql.cj.jdbc.Driver + username: root + password: TSkj@0471.123 + initial-size: 2 + min-idle: 2 + max-active: 100 + # 配置获取连接等待超时的时间 + max-wait: 60000 + # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 + time-between-eviction-runs-millis: 60000 + # 配置一个连接在池中最小生存的时间,单位是毫秒 + min-evictable-idle-time-millis: 300000 + validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + # 打开PSCache,并且指定每个连接上PSCache的大小 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 10 + # 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 + filter: + commons-log: + connection-logger-name: stat,wall,log4j + stat: + log-slow-sql: true + slow-sql-millis: 2000 + # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 + connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 + # 合并多个DruidDataSource的监控数据 + use-global-data-source-stat: true + +mybatis: + config-location: classpath:mybatis/mybatis-config.xml + mapper-locations: classpath*:mybatis/mapper/**/*.xml + +management: + endpoints: + web: + exposure: + include: '*' + enabled-by-default: true + endpoint: + health: + show-details: always + +oauthClient: + clientId: 4995b2989c274e76917a8c6144d4ab3b + clientSecret: ektSeDMwekFDZzl0WnpFQ0ZKZGo1T3NHZkpwODNsdHpmbGU0KzVheHVTQW1ac2wwZTJHWk5NbXh3L3h3U2c4Rg== + +swagger: + title: 接口文档 + description: 用户相关接口文档 + service-url: http://www.wgink.ink + version: 1.0 + swagger-base-package: com.cm + +file: + uploadPath: /root/projects/uploadFiles/ + imageTypes: png,jpg,jpeg,gif,blob + videoTypes: mp4,rmvb + audioTypes: mp3,wmv + fileTypes: doc,docx,xls,xlsx,ppt,pptx,txt,zip,rar,apk,pdf + maxFileCount: 6 + +# 访问控制 +access-control: + pass-paths: + - /index.html + - /logout.html + - /default.html + - /assets/** + - /api/oauthclient/listoauthclient + - /api/oauthclient/countoauthclient + - /api/user/countuser + - /api/file/uploadfile + save-paths: + - /save*/** + - /add*/** + delete-paths: + - /delete*/** + - /remove*/** + update-paths: + - /update*/** + - /edit*/** + query-paths: + - /get*/** + - /query*/** + - /find*/** + - /list*/** + - /count*/** + +logging: + file: /root/projects/logs/usercenter/serviceuser-v2-logs.log + level: + root: error + com.cm: debug diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 7305aa6..793832c 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -1,16 +1,10 @@ server: -# port: 8081 - port: 8868 -# url: http://58.18.22.25:8081/usercenter - url: http://49.233.36.36:8868/usercenter + port: 7001 + url: http://8.130.18.79:7001/usercenter title: 统一用户管理平台 login-page-name: 统一用户管理平台 servlet: context-path: /usercenter -# tomcat: -# remote-ip-header: X-Forwarded-For -# protocol-header: X-Forwarded-Proto -# protocol-header-https-value: https spring: login-url: /oauth/login @@ -33,11 +27,11 @@ spring: max-request-size: 1GB datasource: druid: - url: jdbc:mysql://127.0.0.1:6688/db_cloud_v2?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC + url: jdbc:mysql://127.0.0.1:3306/db_cloud_usercenter?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC db-type: mysql driver-class-name: com.mysql.cj.jdbc.Driver - username: root - password: WenG>)#!^)).12#$ + username: usercenter + password: usercenter initial-size: 2 min-idle: 2 max-active: 10 @@ -92,8 +86,7 @@ swagger: swagger-base-package: com.cm file: -# uploadPath: D:\projects\uploadFiles\ - uploadPath: /root/develop/projects/uploadFiles/ + uploadPath: D:\projects\uploadFiles\ imageTypes: png,jpg,jpeg,gif,blob videoTypes: mp4,rmvb audioTypes: mp3,wmv @@ -128,46 +121,7 @@ access-control: - /count*/** logging: -# file: D:\projects\logs\usercenter\serviceuser-logs.log - file: /root/develop/projects/logs/usercenter/serviceuser-logs.log + file: D:\projects\logs\usercenter-logs.log level: root: error com.cm: debug - -# 短信服务 -sms: - active: true - type: default - default-sms: - account: xd001382 - password: xd001382136 - sign: 【腾狮科技】 - template: - verification-code: '{sign} 您的验证码为 {content}, 有效时间为120秒,若非本人操作,请忽略。' - -# 邮件服务 -email: - active: true - smtp: smtp.qq.com - port: 587 - sender-email: 450292408@qq.com - sender-password: pezxpunlxzqgbhhd - cc-persons: - - 450292408@qq.com - - 76158045@qq.com - -socket: - central-control: - active: true - server: - port: 8888 - # 最大连接数 - so-backlog: 1024 - # 服务端超时断连(秒) - read-idle-time-second: 10 - # 离线通知时间(分钟),默认10分钟 - offline-notice-minute: 10 - # 离线通知次数 - offline-notice-count: 3 - # 异常通知最大值 - exception-notice-count: 10 \ No newline at end of file diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 61d454a..453bf3a 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -31,13 +31,10 @@ spring: port: 6379 datasource: druid: -# url: jdbc:mysql://49.233.36.36:6688/db_cloud?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC - url: jdbc:mysql://127.0.0.1:3306/db_jnhb_usercenter?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC + url: jdbc:mysql://127.0.0.1:3306/db_btyjj_usercenter?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false&serverTimezone=UTC db-type: mysql driver-class-name: com.mysql.cj.jdbc.Driver -# username: wanggeng username: root -# password: WenG>2132997 password: root initial-size: 2 min-idle: 2 @@ -141,105 +138,3 @@ logging: level: root: error com.cm: debug - -# 短信服务 -sms: - active: false - type: default - default-sms: - account: xd001382 - password: xd001382136 - sign: 【日喀则文化馆】 - template: - verification-code: '{sign} 您的验证码为 {content}, 有效时间为120秒,若非本人操作,请忽略。' - -open-platform: - # 钉钉 - dingding: - # 扫码登陆,通过扫码拿到用户unionid,通过access_token获取个人信息,需要设置钉钉通讯录权限,设置访问白名单 - scan-code-login: - app-id: dingoaorwac5cel8rt57rz - app-secret: j5n_xRR5eiWGWdNSr3z1UNtGnSRxb1sLp2aKHofwiUuxT8cnJRc46bXTCDBe2t_x - userinfo-url: https://oapi.dingtalk.com/sns/getuserinfo_bycode - # 必须有一个APP来辅助钉钉扫码登陆 - app: - active: false - agent-id: 295981340 - app-key: dingxz2jzohb7dft9iw7 - app-secret: MWjSN1PUML-tCjgiSCOUR62Fs_-bdJSaHcorWhLZsd6pKTw6YL-USdsW87QWLxd6 - token-url: https://oapi.dingtalk.com/gettoken - userid-by-unionid-url: https://oapi.dingtalk.com/user/getUseridByUnionid - userinfo-by-id-url: https://oapi.dingtalk.com/user/get - # 微信 - wechat: - mini-app: - # 激活状态 - active: false - authorizeUrl: https://api.weixin.qq.com/sns/jscode2session - # 绑定用户连接,指向统一用户,可以内网 - bindUserUrl: http://127.0.0.1:7001/usercenter/wxminiapp/sign/logincheckusername - grantType: authorization_code -# appKey: wxe17874894f7ff27b -# appSecret: 9ab6a87ccedf6555809f1a42e3820f12 -# appKey: wx953da91650b16128 -# appSecret: 69ba0f0223da28e1472a9fe33b4c34d7 - appKey: wxc529578602bca580 - appSecret: fb752f8eed90ed449e7194c82756bb7f - # 公众号 - official-account: - # 开启跨域 - apiCrossOrigin: false - activate: false - authorize: - authorize-url: https://open.weixin.qq.com/connect/oauth2/authorize - access-token-url: https://api.weixin.qq.com/sns/oauth2/access_token - access-token-refresh-url: https://api.weixin.qq.com/sns/oauth2/refresh_token - userinfo-url: https://api.weixin.qq.com/sns/userinfo - response-type: code - scope: snsapi_userinfo - state: wechatRedirectUrl - grant-type: authorization_code - access-token-url: https://api.weixin.qq.com/cgi-bin/token - bind-user-url: http://192.168.0.113:7001/usercenter/wechat/sign/login - app-id: wx583634d14c596fd7 - app-secret: 1158dcddd267c6f42b99bda62f842893 - grant-type: client_credential - config-token: WenG - -# 邮件服务 -email: - active: false - smtp: smtp.163.com - port: 25 - sender-email: dpdbd001@163.com - sender-password: WAASUQNNVITVXDJS - cc-persons: - - 450292408@qq.com - - 76158045@qq.com - -socket: - central-control: - active: false - server: - port: 8888 - # 最大连接数 - so-backlog: 1024 - # 服务端超时断连(秒) - read-idle-time-second: 10 - # 离线通知时间(分钟),默认10分钟 - offline-notice-minute: 1 - # 离线通知次数 - offline-notice-count: 3 - # 异常通知最大值 - exception-notice-count: 10 - client: - client-id: 317dce24-79cb-41c4-9d59-8b7eaa146eb1 - client-secret: DpLh+yC8k6JwVEqsf+DCelvvIKlYd6HO60EH8hUdiWuANOlRunYMCMoUsGr0Gqh3 - host: 49.233.36.36 - port: 8888 - max-reconnect-count: 20 - reconnect-time-step: 1 - delay-ping-seconds: 3 - send-client-info-active: true - # 上报服务器数据时间 - send-client-info-second: 30 diff --git a/src/main/resources/static/route/system/user/save-department.html b/src/main/resources/static/route/system/user/save-department.html index 61bc817..a82d20d 100644 --- a/src/main/resources/static/route/system/user/save-department.html +++ b/src/main/resources/static/route/system/user/save-department.html @@ -137,9 +137,6 @@ if(/(^\_)|(\__)|(\_+$)/.test(value)){ return '用户名首尾不能出现下划线\'_\''; } - if(/^\d+\d+\d$/.test(value)){ - return '用户名不能全为数字'; - } } });