From 8e78c098015451c14d07cb21bb052e76a1617825 Mon Sep 17 00:00:00 2001 From: DB <2502523450@qq.com> Date: Wed, 18 Oct 2023 17:48:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=95=86=E5=9F=8E=E6=A8=A1?= =?UTF-8?q?=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/cpop/core/config/FilterConfig.java | 59 ++++++++ .../core/service/impl/CoreServiceImpl.java | 1 + .../service/impl/CardTemplateServiceImpl.java | 4 +- Cpop-Mall/Cpop-Mall-Web/pom.xml | 47 +++++++ .../cpop/mall/web/CpopMallWebApplication.java | 13 ++ .../src/main/resources/application-dev.yml | 80 +++++++++++ .../src/main/resources/application-prod.yml | 60 +++++++++ .../src/main/resources/application-test.yml | 81 +++++++++++ .../src/main/resources/application.yml | 127 ++++++++++++++++++ .../resources/static/i18n/messages.properties | 0 .../static/i18n/messages_en_US.properties | 33 +++++ .../static/i18n/messages_zh_CN.properties | 33 +++++ .../mall/web/CpopMallWebApplicationTests.java | 13 ++ Cpop-Mall/pom.xml | 24 ++++ .../src/main/resources/application-mall.yml | 1 + .../src/main/resources/application.yml | 9 ++ .../service/impl/DeptServiceImpl.java | 10 +- pom.xml | 6 + 18 files changed, 594 insertions(+), 7 deletions(-) create mode 100644 Cpop-Core/src/main/java/com/cpop/core/config/FilterConfig.java create mode 100644 Cpop-Mall/Cpop-Mall-Web/pom.xml create mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/java/com/cpop/mall/web/CpopMallWebApplication.java create mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-dev.yml create mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-prod.yml create mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-test.yml create mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/application.yml create mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages.properties create mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages_en_US.properties create mode 100644 Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages_zh_CN.properties create mode 100644 Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopMallWebApplicationTests.java create mode 100644 Cpop-Mall/pom.xml create mode 100644 Cpop-Mall/src/main/resources/application-mall.yml diff --git a/Cpop-Core/src/main/java/com/cpop/core/config/FilterConfig.java b/Cpop-Core/src/main/java/com/cpop/core/config/FilterConfig.java new file mode 100644 index 0000000..a43370f --- /dev/null +++ b/Cpop-Core/src/main/java/com/cpop/core/config/FilterConfig.java @@ -0,0 +1,59 @@ +package com.cpop.core.config; + +import com.cpop.common.utils.StringUtils; +import com.cpop.core.filter.XssFilter; +import lombok.Data; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.web.servlet.FilterRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.servlet.DispatcherType; +import java.util.HashMap; +import java.util.Map; + +/** + * Filter配置 + * + * @author DB + */ +@Data +@Configuration +@ConfigurationProperties(prefix = "xss") +public class FilterConfig { + + /** + * 排除链接(多个用逗号分隔) + */ + private String excludes; + + /** + * 匹配链接 + */ + private String urlPatterns; + + /** + * @Description: xss过滤器 + * @param + * @return: FilterRegistrationBean + * @Author: DB + * @Date: 2023/4/17 9:17 + **/ + @SuppressWarnings({"rawtypes", "unchecked"}) + @Bean + @ConditionalOnProperty(value = "xss.enabled", havingValue = "true") + public FilterRegistrationBean xssFilterRegistration() { + FilterRegistrationBean registration = new FilterRegistrationBean(); + registration.setDispatcherTypes(DispatcherType.REQUEST); + registration.setFilter(new XssFilter()); + registration.addUrlPatterns(StringUtils.split(urlPatterns, ",")); + registration.setName("xssFilter"); + registration.setOrder(FilterRegistrationBean.HIGHEST_PRECEDENCE); + Map initParameters = new HashMap(); + initParameters.put("excludes", excludes); + registration.setInitParameters(initParameters); + return registration; + } + +} diff --git a/Cpop-Core/src/main/java/com/cpop/core/service/impl/CoreServiceImpl.java b/Cpop-Core/src/main/java/com/cpop/core/service/impl/CoreServiceImpl.java index c95b89f..b3edb80 100644 --- a/Cpop-Core/src/main/java/com/cpop/core/service/impl/CoreServiceImpl.java +++ b/Cpop-Core/src/main/java/com/cpop/core/service/impl/CoreServiceImpl.java @@ -47,6 +47,7 @@ public class CoreServiceImpl implements CoreService { .setCode(operationLogEnum.getCode()) .setInfo(MessageUtils.message(operationLogEnum.getInfo())) .setDevIp(loginUser.getIpAddr()) + .setOperationUserType(loginUser.getUserType()) .setOperationUserName(loginUser.getUsername()); if (200 == status) { operationLog.setOperationUserId(loginUser.getUserId()) diff --git a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CardTemplateServiceImpl.java b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CardTemplateServiceImpl.java index 2bd252b..72de680 100644 --- a/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CardTemplateServiceImpl.java +++ b/Cpop-Jambox/src/main/java/com/cpop/jambox/business/service/impl/CardTemplateServiceImpl.java @@ -1,8 +1,6 @@ package com.cpop.jambox.business.service.impl; import cn.binarywang.wx.miniapp.api.WxMaService; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.spring.service.impl.ServiceImpl; import com.cpop.common.utils.bean.BeanUtils; import com.cpop.core.base.exception.ServiceException; import com.cpop.core.utils.SpringUtils; @@ -13,6 +11,8 @@ import com.cpop.jambox.business.mapper.CardTemplateMapper; import com.cpop.jambox.business.service.CardTemplateService; import com.cpop.jambox.business.vo.CardTemplateListVo; import com.cpop.sdk.framework.handler.qCloudCos.QCloudCosHandler; +import com.mybatisflex.core.query.QueryWrapper; +import com.mybatisflex.spring.service.impl.ServiceImpl; import me.chanjar.weixin.common.error.WxErrorException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/Cpop-Mall/Cpop-Mall-Web/pom.xml b/Cpop-Mall/Cpop-Mall-Web/pom.xml new file mode 100644 index 0000000..ee01563 --- /dev/null +++ b/Cpop-Mall/Cpop-Mall-Web/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + + com.cpop + Cpop-Union + 1.0.0 + ../../pom.xml + + Cpop-Mall-Web + Cpop-Mall-Web + Cpop-Mall-Web + jar + + + + + com.cpop + Cpop-Mall + + + + com.mysql + mysql-connector-j + runtime + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + + diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/java/com/cpop/mall/web/CpopMallWebApplication.java b/Cpop-Mall/Cpop-Mall-Web/src/main/java/com/cpop/mall/web/CpopMallWebApplication.java new file mode 100644 index 0000000..63e20a0 --- /dev/null +++ b/Cpop-Mall/Cpop-Mall-Web/src/main/java/com/cpop/mall/web/CpopMallWebApplication.java @@ -0,0 +1,13 @@ +package com.cpop.mall.web; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class CpopMallWebApplication { + + public static void main(String[] args) { + SpringApplication.run(CpopMallWebApplication.class, args); + } + +} diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-dev.yml b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-dev.yml new file mode 100644 index 0000000..b57810a --- /dev/null +++ b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-dev.yml @@ -0,0 +1,80 @@ +# 项目相关配置 +cpop: + # 文件路径 示例( Windows配置W:/WorkSpace/java/uploadPath,Linux配置 /home/baseFramework/uploadPath) + profile: E:/Cpop/uploadPath + jwt: + #白名单 + whiteList: /login,/getCaptcha,/profile/**,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources + gateway: + rsa-keypair: + # 公钥文件 + publicKeyFile: E:\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keyPair\publicKey + # 公钥文件 + privateKeyFile: E:\Cpop\Cpop-Union\Cpop-Core\src\main\resources\static\keyPair\privateKey + +# DataSource Config +spring: + application: + name: Cpop-Mall-Dev + datasource: + url: jdbc:mysql://localhost:3306/cpop-union?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: root + #redis配置 + redis: + #地址 + host: localhost + #端口 + port: 6379 + #数据库 + database: 0 + #密码 + password: + #连接超时 + timeout: 5000 + lettuce: + pool: + # + min-idle: 0 + # + max-idle: 8 + # + max-active: 8 + # + max-wait: -1ms + data: + mongodb: + host: localhost + port: 27017 + database: cpop-union + +server: + port: 9420 + servlet: + context-path: /Cpop-Mall + +#Mybatis-Flex +mybatis-flex: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + +# springdoc-openapi项目配置 +knife4j: + enable: true + openapi: + title: Cpop-Mall开发API + description: Cpop-Mall开发API + email: + concat: DB + url: https://api.jamboxsys.com + version: 1.0.0 + license: Apache 2.0 + license-url: https://stackoverflow.com/ + terms-of-service-url: https://api.jamboxsys.com + group: + #系统 + system: + group-name: Mall + api-rule: package + api-rule-resources: + - com.cpop.mall \ No newline at end of file diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-prod.yml b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-prod.yml new file mode 100644 index 0000000..316b6dc --- /dev/null +++ b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-prod.yml @@ -0,0 +1,60 @@ +# 项目相关配置 +cpop: + # 文件路径 示例( Windows配置W:/WorkSpace/java/uploadPath,Linux配置 /home/baseFramework/uploadPath) + profile: /root/jambox-union/jambox-oam/uploadPath/upload + jwt: + #白名单 + whiteList: /login,/getCaptcha,/profile/**,/wxOpen/receiveTicket,/wxOpen/*/callback,/wxOpen/bindOpenAccount/*,/wxCp/portal/* + #拦截 + gateway: + rsa-keypair: + # 公钥文件 + publicKeyFile: /root/jambox-union/jambox-oam/script/secretKey/publicKey + # 公钥文件 + privateKeyFile: /root/jambox-union/jambox-oam/script/secretKey/privateKey + +# DataSource Config +spring: + application: + name: Cpop-Oam-Prod + datasource: + url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop-union?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: Customer0401 + #redis配置 + redis: + #地址 + host: 106.52.49.102 + #端口 + port: 6333 + #数据库 + database: 5 + #密码 + password: Jambox.123* + #连接超时 + timeout: 5000 + lettuce: + pool: + # + min-idle: 0 + # + max-idle: 8 + # + max-active: 8 + # + max-wait: -1ms + data: + mongodb: + host: localhost + port: 27017 + database: rock-blade + +server: + port: 9420 + servlet: + context-path: /Cpop-Oam + +#Mybatis-Flex +mybatis-flex: + configuration: + log-impl: org.apache.ibatis.logging.nologging.NoLoggingImpl \ No newline at end of file diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-test.yml b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-test.yml new file mode 100644 index 0000000..e890337 --- /dev/null +++ b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application-test.yml @@ -0,0 +1,81 @@ +# 项目相关配置 +cpop: + # 文件路径 示例( Windows配置W:/WorkSpace/java/uploadPath,Linux配置 /home/baseFramework/uploadPath) + profile: /root/jambox-union/jambox-oam/uploadPath/upload + jwt: + #白名单 + whiteList: /login,/getCaptcha,/profile/**,/doc.html,/webjars/**,/favicon.ico,/v2/api-docs/**,/swagger-resources,/wxOpen/receiveTicket,/wxOpen/*/callback,/wxOpen/bindOpenAccount/*,/wxCp/portal/* + #拦截 + gateway: + rsa-keypair: + # 公钥文件 + publicKeyFile: /root/jambox-union/jambox-oam/script/secretKey/publicKey + # 公钥文件 + privateKeyFile: /root/jambox-union/jambox-oam/script/secretKey/privateKey + +# DataSource Config +spring: + application: + name: Cpop-Oam-Test + datasource: + url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop-union?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: Customer0401 + #redis配置 + redis: + #地址 + host: 106.52.49.102 + #端口 + port: 6333 + #数据库 + database: 5 + #密码 + password: Jambox.123* + #连接超时 + timeout: 5000 + lettuce: + pool: + # + min-idle: 0 + # + max-idle: 8 + # + max-active: 8 + # + max-wait: -1ms + data: + mongodb: + host: localhost + port: 27017 + database: rock-blade + +server: + port: 9420 + servlet: + context-path: /Cpop-Oam + +#Mybatis-Flex +mybatis-flex: + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + +# springdoc-openapi项目配置 +knife4j: + enable: true + openapi: + title: Cpop-OAM开发API + description: PuPu-OAM开发API + email: + concat: DB + url: https://api.jamboxsys.com + version: 1.0.0 + license: Apache 2.0 + license-url: https://stackoverflow.com/ + terms-of-service-url: https://api.jamboxsys.com + group: + #系统 + system: + group-name: Oam + api-rule: package + api-rule-resources: + - com.cpop.oam \ No newline at end of file diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application.yml b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application.yml new file mode 100644 index 0000000..f7b16ec --- /dev/null +++ b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/application.yml @@ -0,0 +1,127 @@ +# 项目相关配置 +cpop: + # 名称 + name: Cpop-Mall + # 版本 + version: 1.0.0 + #JWT + jwt: + #密钥 + secret: abcdefghijklmnopqrstuvwxyz + #过期时间 + expire: 604800 + #token头 + header: Authorization + #拦截 + gateway: + rsa-keypair: + # 加密方式 + algorithm: RSA + # 初始化大小 + keySize: 2048 + +#Spring +spring: + mvc: + pathmatch: + matching-strategy: ant_path_matcher + servlet: + multipart: + #文件最大传输 + max-file-size: 1024MB + max-request-size: 300MB + profiles: + active: dev,mall + datasource: + type: com.zaxxer.hikari.HikariDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + #hikari数据源特性配置 + hikari: + #最大连接数,默认值10. + maximum-pool-size: 10 + #最小空闲连接,默认值10. + minimum-idle: 10 + #连接超时时间(毫秒),默认值30秒. + connection-timeout: 30000 + #空闲连接超时时间,默认值600000(10分钟),只有空闲连接数大于最大连接数且空闲时间超过该值,才会被释放;如果大于等于 max-lifetime 且 max-lifetime>0,则会被重置为0. + idle-timeout: 600000 + #连接最大存活时间,默认值30分钟.设置应该比mysql设置的超时时间短 + max-lifetime: 3000000 + #连接测试查询 + connection-test-query: select 1 + messages: + #i18n + basename: static/i18n/messages + encoding: UTF-8 + cacheDuration: 3600 + quartz: + job-store-type: jdbc + jdbc: + initialize-schema: embedded + #定时任务启动开关,true-开 false-关 + auto-startup: true + #延迟1秒启动定时任务 + startup-delay: 1s + #启动时更新己存在的Job + overwrite-existing-jobs: true + properties: + org: + quartz: + scheduler: + instanceName: CpopMallScheduler + instanceId: AUTO + jobStore: + class: org.springframework.scheduling.quartz.LocalDataSourceJobStore + driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate + tablePrefix: QRTZ_ + isClustered: false + misfireThreshold: 12000 + clusterCheckinInterval: 15000 + threadPool: + class: org.quartz.simpl.SimpleThreadPool + threadCount: 1 + threadPriority: 5 + threadsInheritContextClassLoaderOfInitializingThread: true + +#Mybatis-Flex +mybatis-flex: + global-config: + key-config: + key-type: generator + value: snowFlakeId + # 逻辑删除数据存在标记值 默认值:0 + normal-value-of-logic-delete: 0 + # 逻辑删除数据删除标记值 默认值:0 + deleted-value-of-logic-delete: 1 + # 全局逻辑删除默认字段 + logic-delete-column: is_delete + +# 线程池配置参数 +task: + pool: + # 设置核心线程数 + corePoolSize: 10 + # 设置最大线程数 + maxPoolSize: 20 + # 设置空闲线程存活时间(秒 + keepAliveSeconds: 300 + # 设置队列容量 + queueCapacity: 100 + # 设置线程名称前缀 + threadNamePrefix: "Cpop-Mall-AsyncNotify-" + # 设置线程池等待终止时间(秒) + awaitTerminationSeconds: 60 + +# 防止XSS攻击 +xss: + # 过滤开关 + enabled: true + # 排除链接(多个用逗号分隔) + excludes: + # 匹配链接 + urlPatterns: /mall/* + +logging: + level: + #swagger日志 + springfox: error \ No newline at end of file diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages.properties b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages.properties new file mode 100644 index 0000000..e69de29 diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages_en_US.properties b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages_en_US.properties new file mode 100644 index 0000000..f09ef9c --- /dev/null +++ b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages_en_US.properties @@ -0,0 +1,33 @@ +#\u767B\u5F55\u4FE1\u606F +i18n_login_success=Login Success +i18n_loginOut_success=Login Out Success + +#\u64CD\u4F5C\u65E5\u5FD7\u4FE1\u606F +i18n_operationLog_systemLogin=System User Login +i18n_operationLog_systemLogout=System User Logout +i18n_operationLog_updateOamConfig=Update System Config +i18n_operationLog_insertOamMenu=Insert Oam Menu +i18n_operationLog_updateOamMenu=Update Oam Menu +i18n_operationLog_removeOamMenu=Remove Oam Menu +i18n_operationLog_insertOamRole=Insert Oam Role +i18n_operationLog_updateOamRole=Update Oam Role +i18n_operationLog_removeOamRole=Remove Oam Role +i18n_operationLog_insertOamDept=Insert Oam Dept +i18n_operationLog_updateOamDept=Update Oam Dept +i18n_operationLog_removeOamDept=Remove Oam Dept +i18n_operationLog_insertOamStaff=Insert Oam User +i18n_operationLog_updateOamStaff=Update Oam User +i18n_operationLog_removeOamStaff=Remove Oam User +i18n_operationLog_updateOamStaffPassword=Update Oam Staff Password + +#\u7CFB\u7EDF\u63D0\u793A\u4FE1\u606F +i18n_alert_accountOrPwdError=Username or password is wrong! +i18n_alert_peopleUnderTheDepartmentError=There are people under the department, it is not allowed to delete the department! +i18n_alert_departmentNotDeactivatedError=The current department is not deactivated, deletion is not allowed\uFF01 +i18n_alert_userOrPhoneOrEmailIsExist=Username or mobile phone number or email address already exists +i18n_alert_userIsExist=User already exists +i18n_alert_oldPasswordIsWrong=The old password was entered incorrectly, please try again + +#\u7CFB\u7EDF\u57FA\u7840\u4FE1\u606F +i18n_baseInfo_success=Success +i18n_baseInfo_failed=Failed diff --git a/Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages_zh_CN.properties b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages_zh_CN.properties new file mode 100644 index 0000000..9353e1e --- /dev/null +++ b/Cpop-Mall/Cpop-Mall-Web/src/main/resources/static/i18n/messages_zh_CN.properties @@ -0,0 +1,33 @@ +#\u767B\u5F55\u4FE1\u606F +i18n_login_success=\u767B\u5F55\u6210\u529F +i18n_loginOut_success=\u767B\u51FA\u6210\u529F + +#\u64CD\u4F5C\u65E5\u5FD7\u4FE1\u606F +i18n_operationLog_systemLogin=\u7CFB\u7EDF\u7528\u6237\u767B\u5F55 +i18n_operationLog_systemLogout=\u7CFB\u7EDF\u7528\u6237\u9000\u51FA +i18n_operationLog_updateOamConfig=\u4FEE\u6539\u7CFB\u7EDF\u914D\u7F6E +i18n_operationLog_insertOamMenu=\u6DFB\u52A0OAM\u83DC\u5355 +i18n_operationLog_updateOamMenu=\u4FEE\u6539OAM\u83DC\u5355 +i18n_operationLog_removeOamMenu=\u5220\u9664OAM\u83DC\u5355 +i18n_operationLog_insertOamRole=\u6DFB\u52A0OAM\u89D2\u8272 +i18n_operationLog_updateOamRole=\u4FEE\u6539OAM\u89D2\u8272 +i18n_operationLog_removeOamRole=\u5220\u9664OAM\u89D2\u8272 +i18n_operationLog_insertOamDept=\u6DFB\u52A0OAM\u90E8\u95E8 +i18n_operationLog_updateOamDept=\u4FEE\u6539OAM\u90E8\u95E8 +i18n_operationLog_removeOamDept=\u5220\u9664OAM\u90E8\u95E8 +i18n_operationLog_insertOamStaff=\u6DFB\u52A0OAM\u7528\u6237 +i18n_operationLog_updateOamStaff=\u4FEE\u6539OAM\u7528\u6237 +i18n_operationLog_removeOamStaff=\u5220\u9664OAM\u7528\u6237 +i18n_operationLog_updateOamStaffPassword=\u4FEE\u6539OAM\u7528\u6237\u5BC6\u7801 + +#\u7CFB\u7EDF\u63D0\u793A\u4FE1\u606F +i18n_alert_accountOrPwdError=\u8D26\u53F7\u6216\u5BC6\u7801\u9519\u8BEF\uFF01 +i18n_alert_peopleUnderTheDepartmentError=\u5F53\u524D\u90E8\u95E8\u4E0B\u6709\u4EBA\u5458\uFF0C\u4E0D\u5141\u8BB8\u5220\u9664\u90E8\u95E8\uFF01 +i18n_alert_departmentNotDeactivatedError=\u5F53\u524D\u90E8\u95E8\u672A\u505C\u7528\uFF0C\u4E0D\u5141\u8BB8\u5220\u9664\u90E8\u95E8\uFF01 +i18n_alert_userOrPhoneOrEmailIsExist=\u7528\u6237\u540D\u6216\u624B\u673A\u53F7\u6216\u90AE\u7BB1\u5DF2\u5B58\u5728 +i18n_alert_userIsExist=\u7528\u6237\u5DF2\u5B58\u5728 +i18n_alert_oldPasswordIsWrong=\u65E7\u5BC6\u7801\u8F93\u5165\u9519\u8BEF\uFF0C\u8BF7\u91CD\u65B0\u8F93\u5165 + +#\u7CFB\u7EDF\u57FA\u7840\u4FE1\u606F +i18n_baseInfo_success=\u6210\u529F +i18n_baseInfo_failed=\u5931\u8D25 diff --git a/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopMallWebApplicationTests.java b/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopMallWebApplicationTests.java new file mode 100644 index 0000000..c2d5657 --- /dev/null +++ b/Cpop-Mall/Cpop-Mall-Web/src/test/java/com/cpop/mall/web/CpopMallWebApplicationTests.java @@ -0,0 +1,13 @@ +package com.cpop.mall.web; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class CpopMallWebApplicationTests { + + @Test + void contextLoads() { + } + +} diff --git a/Cpop-Mall/pom.xml b/Cpop-Mall/pom.xml new file mode 100644 index 0000000..1c52ea0 --- /dev/null +++ b/Cpop-Mall/pom.xml @@ -0,0 +1,24 @@ + + + 4.0.0 + + com.cpop + Cpop-Union + 1.0.0 + ../pom.xml + + Cpop-Mall + Cpop-Mall + Cpop-商城 + jar + + + + + com.cpop + Cpop-Core + + + + diff --git a/Cpop-Mall/src/main/resources/application-mall.yml b/Cpop-Mall/src/main/resources/application-mall.yml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Cpop-Mall/src/main/resources/application-mall.yml @@ -0,0 +1 @@ + diff --git a/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application.yml b/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application.yml index b62e9bb..a957a11 100644 --- a/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application.yml +++ b/Cpop-Oam/Cpop-Oam-Web/src/main/resources/application.yml @@ -112,6 +112,15 @@ task: # 设置线程池等待终止时间(秒) awaitTerminationSeconds: 60 +# 防止XSS攻击 +xss: + # 过滤开关 + enabled: true + # 排除链接(多个用逗号分隔) + excludes: + # 匹配链接 + urlPatterns: /oam/* + logging: level: #swagger日志 diff --git a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DeptServiceImpl.java b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DeptServiceImpl.java index 510f68a..cb3307d 100644 --- a/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DeptServiceImpl.java +++ b/Cpop-Oam/src/main/java/com/cpop/oam/business/service/impl/DeptServiceImpl.java @@ -1,7 +1,5 @@ package com.cpop.oam.business.service.impl; -import com.mybatisflex.core.query.QueryWrapper; -import com.mybatisflex.spring.service.impl.ServiceImpl; import com.cpop.common.utils.StringUtils; import com.cpop.common.utils.bean.BeanUtils; import com.cpop.core.base.exception.ServiceException; @@ -12,8 +10,10 @@ import com.cpop.oam.business.bo.DeptListBo; import com.cpop.oam.business.entity.Dept; import com.cpop.oam.business.mapper.DeptMapper; import com.cpop.oam.business.service.DeptService; -import com.cpop.oam.business.service.StaffService; +import com.cpop.oam.business.service.StaffMidDeptService; import com.cpop.oam.business.vo.DeptVo; +import com.mybatisflex.core.query.QueryWrapper; +import com.mybatisflex.spring.service.impl.ServiceImpl; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -21,7 +21,7 @@ import java.util.List; import java.util.stream.Collectors; import static com.cpop.oam.business.entity.table.DeptTableDef.DEPT; -import static com.cpop.oam.business.entity.table.StaffTableDef.STAFF; +import static com.cpop.oam.business.entity.table.StaffMidDeptTableDef.STAFF_MID_DEPT; /** * 部门表 服务层实现。 @@ -159,7 +159,7 @@ public class DeptServiceImpl extends ServiceImpl implements De //递归获取当前部门与子部门 List deptIds = filterSonDept(list, id); //删除部门,首先要查询员工 - if (SpringUtils.getBean(StaffService.class).count(QueryWrapper.create().where(STAFF.DEPT_ID.in(deptIds))) > 0) { + if (SpringUtils.getBean(StaffMidDeptService.class).count(QueryWrapper.create().where(STAFF_MID_DEPT.DEPT_ID.in(deptIds))) > 0) { throw new ServiceException(MessageUtils.message("i18n_alert_peopleUnderTheDepartmentError")); } else { //当部门人员及其子部门人员为空时,才允许删除部门 diff --git a/pom.xml b/pom.xml index a4f96ef..dfbfb77 100644 --- a/pom.xml +++ b/pom.xml @@ -25,6 +25,7 @@ Cpop-Oam/Cpop-Oam-Web Cpop-Jambox Cpop-Jambox/Cpop-Jambox-Web + Cpop-Mall @@ -110,6 +111,11 @@ Cpop-Jambox ${cpop.version} + + com.cpop + Cpop-Mall + ${cpop.version} + com.zaxxer