Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"configurations": [
{
"type": "java",
"name": "Spring Boot-CrmebAdminApplication<crmeb-admin>",
"request": "launch",
"cwd": "${workspaceFolder}",
"mainClass": "com.zbkj.admin.CrmebAdminApplication",
"projectName": "crmeb-admin",
"args": "",
"envFile": "${workspaceFolder}/.env"
},
{
"type": "java",
"name": "Spring Boot-YlyUtil<crmeb-service>",
"request": "launch",
"cwd": "${workspaceFolder}",
"mainClass": "com.zbkj.service.util.YlyUtil",
"projectName": "crmeb-service",
"args": "",
"envFile": "${workspaceFolder}/.env"
},
{
"type": "java",
"name": "Spring Boot-CrmebFrontApplication<crmeb-front>",
"request": "launch",
"cwd": "${workspaceFolder}",
"mainClass": "com.zbkj.front.CrmebFrontApplication",
"projectName": "crmeb-front",
"args": "",
"envFile": "${workspaceFolder}/.env"
}
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"java.configuration.updateBuildConfiguration": "interactive",
"java.debug.settings.onBuildFailureProceed": true,
"java.compile.nullAnalysis.mode": "automatic"
}
2 changes: 1 addition & 1 deletion admin/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ENV = 'development'
# base api
# VUE_APP_BASE_API = '/dev-api'
# VUE_APP_BASE_API = 'https://api.java.crmeb.net'
VUE_APP_BASE_API = 'http://192.168.31.35:2500'
VUE_APP_BASE_API = 'http://127.0.0.1:8080'

# vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable,
# to control whether the babel-plugin-dynamic-import-node plugin is enabled.
Expand Down
4 changes: 2 additions & 2 deletions app/config/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// | Author: CRMEB Team <[email protected]>
// +----------------------------------------------------------------------
//移动端商城API
let domain = 'http://192.168.31.35:2511'
let domain = 'http://127.0.0.1:8081'
// let domain = 'https://apif.java.crmeb.net'

module.exports = {
Expand All @@ -17,7 +17,7 @@ module.exports = {
// HTTP_REQUEST_URL:'',
HTTP_REQUEST_URL: domain,
// H5商城地址
HTTP_H5_URL: 'http://java.crmeb.net',
HTTP_H5_URL: domain,
// #endif
// #ifdef H5
HTTP_REQUEST_URL:domain,
Expand Down
2 changes: 1 addition & 1 deletion app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,23 @@
@EnableSwagger2
@Configuration
@EnableTransactionManagement
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class) //去掉数据源
//@ComponentScan(basePackages={"com.utils",
// "com.zbkj.crmeb",
// "com.exception",
// "com.common",
// "com.aop"}) //扫描utils包和父包
//@MapperScan(basePackages = {"com.zbkj.crmeb.*.dao", "com.zbkj.crmeb.*.*.dao"})
@SpringBootApplication(
exclude = DataSourceAutoConfiguration.class
, scanBasePackages={
"com.zbkj.common.*",
"com.zbkj.common.utils.*"
}
) //去掉数据源
@ComponentScan({
"com.utils",
"com.zbkj.crmeb",
"com.exception",
"com.common",
"com.aop",
"com.zbkj.common",
"com.zbkj.common.utils"
}) //扫描utils包和父包
@MapperScan(basePackages = {"com.zbkj.crmeb.*.dao", "com.zbkj.crmeb.*.*.dao"})
@ComponentScan(basePackages = {"com.zbkj"})
@MapperScan(basePackages = {"com.zbkj.**.dao"})
public class CrmebAdminApplication {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,19 @@ public CronTrigger getCronTrigger(ScheduleJob scheduleJob) {
public void createScheduleJob(ScheduleJob scheduleJob) {
try {
//构建job信息
JobDetail jobDetail = JobBuilder.newJob(QuartzJob.class).withIdentity(getJobKey(scheduleJob)).build();
JobDetail jobDetail = JobBuilder.newJob(QuartzJob.class).withIdentity(
getJobKey(scheduleJob)
).build();

//表达式调度构建器,可以根据scheduleJob修改withMisfireHandling方法,但是使用异步执行定时任务,没必要
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(scheduleJob.getCronExpression())
.withMisfireHandlingInstructionFireAndProceed();
CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(
scheduleJob.getCronExpression()
).withMisfireHandlingInstructionFireAndProceed();

//按新的cronExpression表达式构建一个新的trigger
CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(getTriggerKey(scheduleJob)).withSchedule(scheduleBuilder).build();
CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(
getTriggerKey(scheduleJob)
).withSchedule(scheduleBuilder).build();

//放入参数,运行时的方法可以获取
jobDetail.getJobDataMap().put(QuartzJob.JOB_PARAM_KEY, scheduleJob);
Expand Down
12 changes: 6 additions & 6 deletions crmeb/crmeb-admin/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ crmeb:
demoSite: true # 是否演示站点 所有手机号码都会掩码

server:
port: 20500
port: 8080

spring:
profiles:
Expand All @@ -26,13 +26,13 @@ spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/single_open?characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
username: single_open
password: 111111
url: jdbc:mysql://192.168.33.10:3306/crmeb?characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
username: root
password: 123456
redis:
host: 127.0.0.1 #地址
host: 192.168.33.10 #地址
port: 6379 #端口
password: 111111
password: 123456
timeout: 10000 # 连接超时时间(毫秒)
database: 6 #默认数据库
jedis:
Expand Down
61 changes: 33 additions & 28 deletions crmeb/crmeb-admin/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ spring:
profiles:
# 配置的环境
# active: #spring.profiles.active#
active:
active: dev
servlet:
multipart:
max-file-size: 50MB #设置单个文件大小
Expand All @@ -54,39 +54,44 @@ spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/single_open?serverTimezone=UTC
username: single_open
password: 111111
url: jdbc:mysql://192.168.33.10:3306/crmeb?characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
username: root
password: 123456
# quartz
quartz:
properties:
org:
quartz:
scheduler:
instanceName: quartzScheduler
# instanceName: clusteredScheduler
instanceId: AUTO
jobStore:
class: org.quartz.impl.jdbcjobstore.JobStoreTX
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
tablePrefix: QRTZ_
isClustered: false
clusterCheckinInterval: 10000
useProperties: false
# dataSource: crmeb_java_beta
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
#数据库方式
job-store-type: JDBC
enable: false
auto-startup: false
startup-delay: 1000000

# quartz:
# properties:
# org:
# quartz:
# scheduler:
# instanceName: quartzScheduler
# # instanceName: clusteredScheduler
# instanceId: AUTO
# jobStore:
# class: org.quartz.impl.jdbcjobstore.JobStoreTX
# driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
# tablePrefix: QRTZ_
# isClustered: false
# clusterCheckinInterval: 10000
# useProperties: false
# # dataSource: crmeb_java_beta
# threadPool:
# class: org.quartz.simpl.SimpleThreadPool
# threadCount: 10
# threadPriority: 5
# threadsInheritContextClassLoaderOfInitializingThread: true
# #数据库方式
# job-store-type: JDBC


redis:
host: 127.0.0.1 #地址
host: 192.168.33.10 #地址
port: 6379 #端口
password: 111111
password: 123456
timeout: 30000 # 连接超时时间(毫秒)
database: 6 #默认数据库
jedis:
Expand Down
40 changes: 39 additions & 1 deletion crmeb/crmeb-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,46 @@
<artifactId>spring-boot-starter-captcha</artifactId>
<version>1.3.0</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.38</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.14</version>
</dependency>
</dependencies>


<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<!-- java8 保留参数名编译参数 -->
<compilerArgument>-parameters</compilerArgument>
<compilerArguments>
<verbose/>
</compilerArguments>
<!-- <failOnMissingWebXml>false</failOnMissingWebXml> -->
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.38</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import org.springframework.util.AntPathMatcher;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import sun.misc.BASE64Decoder;
// import sun.misc.BASE64Decoder;
import org.apache.commons.codec.binary.Base64;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Expand Down Expand Up @@ -52,7 +53,7 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
public boolean httpBasicAuth(String authorization) throws IOException {
if(check){
if (authorization != null && authorization.split(" ").length == 2) {
String userAndPass = new String(new BASE64Decoder().decodeBuffer(authorization.split(" ")[1]));
String userAndPass = new String(Base64.decodeBase64(authorization.split(" ")[1]));
String username = userAndPass.split(":").length == 2 ? userAndPass.split(":")[0] : null;
String password = userAndPass.split(":").length == 2 ? userAndPass.split(":")[1] : null;
return this.username.equals(username) && this.password.equals(password);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.alibaba.fastjson.JSONObject;
import com.zbkj.common.constants.Constants;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
Expand All @@ -31,6 +32,7 @@
* | Author: CRMEB Team <[email protected]>
* +----------------------------------------------------------------------
*/
@Component
public class CrmebUtil {

public static String encryptPassword(String pwd, String key) {
Expand Down
12 changes: 6 additions & 6 deletions crmeb/crmeb-front/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ crmeb:
asyncConfig: false #是否同步config表数据到redis

server:
port: 20510
port: 8081

spring:
profiles:
Expand All @@ -15,13 +15,13 @@ spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/single_open?characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
username: single_open
password: 111111
url: jdbc:mysql://192.168.33.10:3306/crmeb?characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
username: root
password: 123456
redis:
host: 127.0.0.1 #地址
host: 192.168.33.10 #地址
port: 6379 #端口
password: 111111
password: 123456
timeout: 10000 # 连接超时时间(毫秒)
database: 6 #默认数据库
jedis:
Expand Down
14 changes: 7 additions & 7 deletions crmeb/crmeb-front/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ spring:
profiles:
# 配置的环境
# active: #spring.profiles.active#
active:
active: dev
servlet:
multipart:
max-file-size: 50MB #设置单个文件大小
Expand All @@ -48,13 +48,13 @@ spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/single_open?characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
username: single_open
password: 111111
url: jdbc:mysql://192.168.33.10:3306/crmeb?characterEncoding=utf-8&useSSL=false&serverTimeZone=GMT+8
username: root
password: 123456
redis:
host: 127.0.0.1 #地址
port: 6379 #端口
password: 111111
host: 192.168.33.10
port: 6379
password: 123456
timeout: 30000 # 连接超时时间(毫秒)
database: 6 #默认数据库
jedis:
Expand Down
Loading