Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
mall
Commits
c3359c9f
Commit
c3359c9f
authored
Mar 21, 2019
by
macro
Browse files
springboot升级至2.1.3,elasticsearch升级至6.2.2
parent
470c40eb
Changes
24
Show whitespace changes
Inline
Side-by-side
README.md
View file @
c3359c9f
...
...
@@ -144,7 +144,7 @@ PicPick | 屏幕取色工具 | https://picpick.app/zh/
JDK | 1.8 | https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Mysql | 5.7 | https://www.mysql.com/
Redis | 3.2 | https://redis.io/download
Elasticsearch |
2.4.6
| https://www.elastic.co/downloads
Elasticsearch |
6.2.2
| https://www.elastic.co/downloads
MongoDb | 3.2 | https://www.mongodb.com/download-center
RabbitMq | 5.25 | http://www.rabbitmq.com/download.html
nginx | 1.10 | http://nginx.org/en/download.html
...
...
document/reference/deploy-windows.md
View file @
c3359c9f
...
...
@@ -25,17 +25,19 @@
-
下载地址:https://github.com/MicrosoftArchive/redis/releases
-
下载后按提示进行安装
-
启动redis:redis-server.exe redis.windows.conf
## elasticsearch
-
下载地址:https://www.elastic.co/downloads/past-releases/elasticsearch-
2-4-6
-
下载地址:https://www.elastic.co/downloads/past-releases/elasticsearch-
6-2-2
-
下载.zip文件,解压到指定目录
-
安装head插件,
在elasticsearch-2.4.6
\b
in目录下执行以下命令:plugin install
mobz/elasticsearch-head
-
安装
中文分词插件:https://github.com/medcl/elasticsearch-analysis-ik
-
下载地址:https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v1.10.6/elasticsearch-analysis-ik-1.10.6.zip
-
解压并拷贝到elasticsearch-2.4.6
\p
lugins目录下
-
启动elasticsearch:运行elasticsearch-
2.4.6
\b
in
\e
lasticsearch.bat
-
安装head插件,
具体参考:https://github.com/
mobz/elasticsearch-head
-
中文分词插件
地址
:https://github.com/medcl/elasticsearch-analysis-ik
-
安装中文分词插件,在elasticsearch-6.2.2
\b
in目录下执行以下命令:
elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.2.2/elasticsearch-analysis-ik-6.2.2.zip
-
启动elasticsearch:运行elasticsearch-
6.2.2
\b
in
\e
lasticsearch.bat
-
打开该地址测试是否安装成功:http://localhost:9200/_plugin/head/
-
不使用head插件的可以使用kibana,请下载6.2.2版本,具体参考:https://www.elastic.co/downloads/kibana
## mongodb
...
...
document/sql/mall.sql
View file @
c3359c9f
...
...
@@ -10,7 +10,7 @@ Target Server Type : MYSQL
Target Server Version : 50719
File Encoding : 65001
Date: 2019-0
1
-2
9
1
4:14:36
Date: 2019-0
3
-2
1
1
5:44:19
*/
SET FOREIGN_KEY_CHECKS=0;
...
...
@@ -211,7 +211,7 @@ CREATE TABLE `cms_subject_product_relation` (
`subject_id` bigint(20) DEFAULT NULL,
`product_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=
41
DEFAULT CHARSET=utf8 COMMENT='专题商品关系表';
) ENGINE=InnoDB AUTO_INCREMENT=
39
DEFAULT CHARSET=utf8 COMMENT='专题商品关系表';
-- ----------------------------
-- Records of cms_subject_product_relation
...
...
@@ -421,7 +421,7 @@ INSERT INTO `oms_order` VALUES ('22', '1', '2', '201809150101000005', '2018-09-1
INSERT INTO `oms_order` VALUES ('23', '1', '2', '201809150102000006', '2018-09-15 14:24:29', 'test', '18732.00', '16377.75', '0.00', '2344.25', '0.00', '10.00', '0.00', '1', '1', '1', '0', '顺丰快递', 'xxx', '15', '0', '0', '单品促销,打折优惠:满3件,打7.50折,满减优惠:满1000.00元,减120.00元,满减优惠:满1000.00元,减120.00元,无优惠', null, null, null, null, null, '大梨', '18033441849', '518000', '广东省', '深圳市', '福田区', '东晓街道', null, '0', '0', '1000', null, '2018-10-16 14:41:28', null, null, null);
INSERT INTO `oms_order` VALUES ('24', '1', '2', '201809130101000005', '2018-09-13 16:57:40', 'test', '18732.00', '16377.75', '0.00', '2344.25', '0.00', '10.00', '0.00', '2', '1', '2', '0', null, null, '15', '18682', '18682', '单品促销,打折优惠:满3件,打7.50折,满减优惠:满1000.00元,减120.00元,满减优惠:满1000.00元,减120.00元,无优惠', null, null, null, null, null, '大梨', '18033441849', '518000', '广东省', '深圳市', '福田区', '东晓街道', null, '0', '0', null, null, null, null, null, null);
INSERT INTO `oms_order` VALUES ('25', '1', '2', '201809130102000006', '2018-09-13 17:03:00', 'test', '18732.00', '16377.75', '10.00', '2344.25', '0.00', '10.00', '5.00', '1', '1', '4', '0', null, null, '15', '18682', '18682', '单品促销,打折优惠:满3件,打7.50折,满减优惠:满1000.00元,减120.00元,满减优惠:满1000.00元,减120.00元,无优惠', null, null, null, null, null, '大梨22', '18033441849', '518000', '北京市', '北京城区', '东城区', '东城街道', 'xxx', '0', '0', null, null, null, null, null, '2018-10-30 15:08:31');
INSERT INTO `oms_order` VALUES ('26', '1', '2', '201809140101000003', '2018-09-14 16:16:16', 'test', '18732.00', '16377.75', '0.00', '2344.25', '0.00', '10.00', '0.00', '
2
', '1', '4', '0', null, null, '15', '18682', '18682', '单品促销,打折优惠:满3件,打7.50折,满减优惠:满1000.00元,减120.00元,满减优惠:满1000.00元,减120.00元,无优惠', null, null, null, null, null, '大梨', '18033441849', '518000', '广东省', '深圳市', '福田区', '东晓街道', null, '0', '
1
', null, null, null, null, null, null);
INSERT INTO `oms_order` VALUES ('26', '1', '2', '201809140101000003', '2018-09-14 16:16:16', 'test', '18732.00', '16377.75', '0.00', '2344.25', '0.00', '10.00', '0.00', '
0
', '1', '4', '0', null, null, '15', '18682', '18682', '单品促销,打折优惠:满3件,打7.50折,满减优惠:满1000.00元,减120.00元,满减优惠:满1000.00元,减120.00元,无优惠', null, null, null, null, null, '大梨', '18033441849', '518000', '广东省', '深圳市', '福田区', '东晓街道', null, '0', '
0
', null, null, null, null, null, null);
-- ----------------------------
-- Table structure for oms_order_item
...
...
@@ -1090,7 +1090,7 @@ CREATE TABLE `pms_product_category` (
`keywords` varchar(255) DEFAULT NULL,
`description` text COMMENT '描述',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5
2
DEFAULT CHARSET=utf8 COMMENT='产品分类';
) ENGINE=InnoDB AUTO_INCREMENT=5
3
DEFAULT CHARSET=utf8 COMMENT='产品分类';
-- ----------------------------
-- Records of pms_product_category
...
...
@@ -1405,7 +1405,7 @@ CREATE TABLE `sms_coupon_history` (
-- ----------------------------
-- Records of sms_coupon_history
-- ----------------------------
INSERT INTO `sms_coupon_history` VALUES ('2', '2', '1', '4931048380330002', 'windir', '1', '2018-08-29 14:04:12', '
1
', '201
8-11-12 14:38
:4
7
', '12', '201809150101000001');
INSERT INTO `sms_coupon_history` VALUES ('2', '2', '1', '4931048380330002', 'windir', '1', '2018-08-29 14:04:12', '
0
', '201
9-03-21 15:03
:4
0
', '12', '201809150101000001');
INSERT INTO `sms_coupon_history` VALUES ('3', '3', '1', '4931048380330003', 'windir', '1', '2018-08-29 14:04:29', '0', null, null, null);
INSERT INTO `sms_coupon_history` VALUES ('4', '4', '1', '4931048380330004', 'windir', '1', '2018-08-29 14:04:32', '0', null, null, null);
INSERT INTO `sms_coupon_history` VALUES ('11', '7', '1', '4931048380330001', 'windir', '1', '2018-09-04 16:21:50', '0', null, null, null);
...
...
@@ -1740,13 +1740,13 @@ CREATE TABLE `ums_admin` (
`login_time` datetime DEFAULT NULL COMMENT '最后登录时间',
`status` int(1) DEFAULT '1' COMMENT '帐号启用状态:0->禁用;1->启用',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=
4
DEFAULT CHARSET=utf8 COMMENT='后台用户表';
) ENGINE=InnoDB AUTO_INCREMENT=
5
DEFAULT CHARSET=utf8 COMMENT='后台用户表';
-- ----------------------------
-- Records of ums_admin
-- ----------------------------
INSERT INTO `ums_admin` VALUES ('1', 'test', '
202cb962ac59075b964b07152d234b70
', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/timg.jpg', null, '测试账号', null, '2018-09-29 13:55:30', '2018-09-29 13:55:39', '1');
INSERT INTO `ums_admin` VALUES ('3', 'admin', '
e10adc3949ba59abbe56e057f20f883e
', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20190129/170157_yIl3_1767531.jpg', 'admin@163.com', '系统管理员', '系统管理员', '2018-10-08 13:32:47', '2019-0
1
-2
9
1
0:10
:5
1
', '1');
INSERT INTO `ums_admin` VALUES ('1', 'test', '
$2a$10$NZ5o7r2E.ayT2ZoxgjlI.eJ6OEYqjH7INR/F.mXDbjZJi9HF0YCVG
', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20180607/timg.jpg', null, '测试账号', null, '2018-09-29 13:55:30', '2018-09-29 13:55:39', '1');
INSERT INTO `ums_admin` VALUES ('3', 'admin', '
$2a$10$NZ5o7r2E.ayT2ZoxgjlI.eJ6OEYqjH7INR/F.mXDbjZJi9HF0YCVG
', 'http://macro-oss.oss-cn-shenzhen.aliyuncs.com/mall/images/20190129/170157_yIl3_1767531.jpg', 'admin@163.com', '系统管理员', '系统管理员', '2018-10-08 13:32:47', '2019-0
3
-2
0
1
5:38
:5
0
', '1');
-- ----------------------------
-- Table structure for ums_admin_login_log
...
...
@@ -1760,7 +1760,7 @@ CREATE TABLE `ums_admin_login_log` (
`address` varchar(100) DEFAULT NULL,
`user_agent` varchar(100) DEFAULT NULL COMMENT '浏览器登录类型',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1
2
DEFAULT CHARSET=utf8 COMMENT='后台用户登录日志表';
) ENGINE=InnoDB AUTO_INCREMENT=1
8
DEFAULT CHARSET=utf8 COMMENT='后台用户登录日志表';
-- ----------------------------
-- Records of ums_admin_login_log
...
...
@@ -1772,6 +1772,12 @@ INSERT INTO `ums_admin_login_log` VALUES ('8', '3', '2018-12-18 13:51:51', '0:0:
INSERT INTO `ums_admin_login_log` VALUES ('9', '3', '2019-01-28 16:20:41', '0:0:0:0:0:0:0:1', null, null);
INSERT INTO `ums_admin_login_log` VALUES ('10', '3', '2019-01-29 09:16:25', '0:0:0:0:0:0:0:1', null, null);
INSERT INTO `ums_admin_login_log` VALUES ('11', '3', '2019-01-29 10:10:51', '0:0:0:0:0:0:0:1', null, null);
INSERT INTO `ums_admin_login_log` VALUES ('12', '3', '2019-02-18 11:03:06', '0:0:0:0:0:0:0:1', null, null);
INSERT INTO `ums_admin_login_log` VALUES ('13', '3', '2019-03-12 10:03:55', '0:0:0:0:0:0:0:1', null, null);
INSERT INTO `ums_admin_login_log` VALUES ('14', '3', '2019-03-12 10:06:19', '0:0:0:0:0:0:0:1', null, null);
INSERT INTO `ums_admin_login_log` VALUES ('15', '3', '2019-03-12 10:15:22', '0:0:0:0:0:0:0:1', null, null);
INSERT INTO `ums_admin_login_log` VALUES ('16', '3', '2019-03-20 15:35:33', '0:0:0:0:0:0:0:1', null, null);
INSERT INTO `ums_admin_login_log` VALUES ('17', '3', '2019-03-20 15:38:50', '0:0:0:0:0:0:0:1', null, null);
-- ----------------------------
-- Table structure for ums_admin_permission_relation
...
...
@@ -1898,14 +1904,14 @@ CREATE TABLE `ums_member` (
-- ----------------------------
-- Records of ums_member
-- ----------------------------
INSERT INTO `ums_member` VALUES ('1', '4', 'test', '
202cb962ac59075b964b07152d234b70
', 'windir', '18061581849', '1', '2018-08-02 10:35:44', null, '1', '2009-06-01', '上海', '学生', 'test', null, '5000', null, null, null);
INSERT INTO `ums_member` VALUES ('3', '4', 'windy', '
e10adc3949ba59abbe56e057f20f883e
', 'windy', '18061581848', '1', '2018-08-03 16:46:38', null, null, null, null, null, null, null, null, null, null, null);
INSERT INTO `ums_member` VALUES ('4', '4', 'zhengsan', '
e10adc3949ba59abbe56e057f20f883e
', 'zhengsan', '18061581847', '1', '2018-11-12 14:12:04', null, null, null, null, null, null, null, null, null, null, null);
INSERT INTO `ums_member` VALUES ('5', '4', 'lisi', '
e10adc3949ba59abbe56e057f20f883e
', 'lisi', '18061581841', '1', '2018-11-12 14:12:38', null, null, null, null, null, null, null, null, null, null, null);
INSERT INTO `ums_member` VALUES ('6', '4', 'wangwu', '
e10adc3949ba59abbe56e057f20f883e
', 'wangwu', '18061581842', '1', '2018-11-12 14:13:09', null, null, null, null, null, null, null, null, null, null, null);
INSERT INTO `ums_member` VALUES ('7', '4', 'lion', '
e10adc3949ba59abbe56e057f20f883e
', 'lion', '18061581845', '1', '2018-11-12 14:21:39', null, null, null, null, null, null, null, null, null, null, null);
INSERT INTO `ums_member` VALUES ('8', '4', 'shari', '
e10adc3949ba59abbe56e057f20f883e
', 'shari', '18061581844', '1', '2018-11-12 14:22:00', null, null, null, null, null, null, null, null, null, null, null);
INSERT INTO `ums_member` VALUES ('9', '4', 'aewen', '
e10adc3949ba59abbe56e057f20f883e
', 'aewen', '18061581843', '1', '2018-11-12 14:22:55', null, null, null, null, null, null, null, null, null, null, null);
INSERT INTO `ums_member` VALUES ('1', '4', 'test', '
$2a$10$NZ5o7r2E.ayT2ZoxgjlI.eJ6OEYqjH7INR/F.mXDbjZJi9HF0YCVG
', 'windir', '18061581849', '1', '2018-08-02 10:35:44', null, '1', '2009-06-01', '上海', '学生', 'test', null, '5000', null, null, null);
INSERT INTO `ums_member` VALUES ('3', '4', 'windy', '
$2a$10$NZ5o7r2E.ayT2ZoxgjlI.eJ6OEYqjH7INR/F.mXDbjZJi9HF0YCVG
', 'windy', '18061581848', '1', '2018-08-03 16:46:38', null, null, null, null, null, null, null, null, null, null, null);
INSERT INTO `ums_member` VALUES ('4', '4', 'zhengsan', '
$2a$10$NZ5o7r2E.ayT2ZoxgjlI.eJ6OEYqjH7INR/F.mXDbjZJi9HF0YCVG
', 'zhengsan', '18061581847', '1', '2018-11-12 14:12:04', null, null, null, null, null, null, null, null, null, null, null);
INSERT INTO `ums_member` VALUES ('5', '4', 'lisi', '
$2a$10$NZ5o7r2E.ayT2ZoxgjlI.eJ6OEYqjH7INR/F.mXDbjZJi9HF0YCVG
', 'lisi', '18061581841', '1', '2018-11-12 14:12:38', null, null, null, null, null, null, null, null, null, null, null);
INSERT INTO `ums_member` VALUES ('6', '4', 'wangwu', '
$2a$10$NZ5o7r2E.ayT2ZoxgjlI.eJ6OEYqjH7INR/F.mXDbjZJi9HF0YCVG
', 'wangwu', '18061581842', '1', '2018-11-12 14:13:09', null, null, null, null, null, null, null, null, null, null, null);
INSERT INTO `ums_member` VALUES ('7', '4', 'lion', '
$2a$10$NZ5o7r2E.ayT2ZoxgjlI.eJ6OEYqjH7INR/F.mXDbjZJi9HF0YCVG
', 'lion', '18061581845', '1', '2018-11-12 14:21:39', null, null, null, null, null, null, null, null, null, null, null);
INSERT INTO `ums_member` VALUES ('8', '4', 'shari', '
$2a$10$NZ5o7r2E.ayT2ZoxgjlI.eJ6OEYqjH7INR/F.mXDbjZJi9HF0YCVG
', 'shari', '18061581844', '1', '2018-11-12 14:22:00', null, null, null, null, null, null, null, null, null, null, null);
INSERT INTO `ums_member` VALUES ('9', '4', 'aewen', '
$2a$10$NZ5o7r2E.ayT2ZoxgjlI.eJ6OEYqjH7INR/F.mXDbjZJi9HF0YCVG
', 'aewen', '18061581843', '1', '2018-11-12 14:22:55', null, null, null, null, null, null, null, null, null, null, null);
-- ----------------------------
-- Table structure for ums_member_level
...
...
mall-admin/pom.xml
View file @
c3359c9f
...
...
@@ -13,7 +13,7 @@
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.14
.RELEASE
</version>
<version>
2.1.3
.RELEASE
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
...
...
mall-admin/src/main/java/com/macro/mall/config/SecurityConfig.java
View file @
c3359c9f
...
...
@@ -12,8 +12,7 @@ import org.springframework.boot.web.servlet.FilterRegistrationBean;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.security.authentication.encoding.Md5PasswordEncoder
;
import
org.springframework.security.authentication.encoding.PasswordEncoder
;
import
org.springframework.security.authentication.AuthenticationManager
;
import
org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder
;
import
org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
...
...
@@ -22,6 +21,8 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
import
org.springframework.security.config.http.SessionCreationPolicy
;
import
org.springframework.security.core.userdetails.UserDetailsService
;
import
org.springframework.security.core.userdetails.UsernameNotFoundException
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
;
import
org.springframework.web.cors.CorsConfiguration
;
import
org.springframework.web.cors.UrlBasedCorsConfigurationSource
;
...
...
@@ -90,7 +91,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Bean
public
PasswordEncoder
passwordEncoder
()
{
return
new
Md5
PasswordEncoder
();
return
new
BCrypt
PasswordEncoder
();
}
@Bean
...
...
@@ -127,4 +128,11 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
bean
.
setOrder
(
0
);
return
new
CorsFilter
(
source
);
}
@Bean
@Override
public
AuthenticationManager
authenticationManagerBean
()
throws
Exception
{
return
super
.
authenticationManagerBean
();
}
}
mall-admin/src/main/java/com/macro/mall/service/impl/UmsAdminServiceImpl.java
View file @
c3359c9f
...
...
@@ -17,13 +17,13 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.security.authentication.AuthenticationManager
;
import
org.springframework.security.authentication.BadCredentialsException
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.authentication.encoding.PasswordEncoder
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.AuthenticationException
;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.security.core.userdetails.UserDetailsService
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
...
...
@@ -91,7 +91,7 @@ public class UmsAdminServiceImpl implements UmsAdminService {
return
null
;
}
//将密码进行加密操作
String
md5Password
=
passwordEncoder
.
encode
Password
(
umsAdmin
.
getPassword
()
,
null
);
String
md5Password
=
passwordEncoder
.
encode
(
umsAdmin
.
getPassword
());
umsAdmin
.
setPassword
(
md5Password
);
adminMapper
.
insert
(
umsAdmin
);
return
umsAdmin
;
...
...
@@ -101,11 +101,13 @@ public class UmsAdminServiceImpl implements UmsAdminService {
public
String
login
(
String
username
,
String
password
)
{
String
token
=
null
;
//密码需要客户端加密后传递
UsernamePasswordAuthenticationToken
authenticationToken
=
new
UsernamePasswordAuthenticationToken
(
username
,
passwordEncoder
.
encodePassword
(
password
,
null
));
try
{
Authentication
authentication
=
authenticationManager
.
authenticate
(
authenticationToken
);
SecurityContextHolder
.
getContext
().
setAuthentication
(
authentication
);
UserDetails
userDetails
=
userDetailsService
.
loadUserByUsername
(
username
);
if
(!
passwordEncoder
.
matches
(
password
,
userDetails
.
getPassword
())){
throw
new
BadCredentialsException
(
"密码不正确"
);
}
UsernamePasswordAuthenticationToken
authentication
=
new
UsernamePasswordAuthenticationToken
(
userDetails
,
null
,
userDetails
.
getAuthorities
());
SecurityContextHolder
.
getContext
().
setAuthentication
(
authentication
);
token
=
jwtTokenUtil
.
generateToken
(
userDetails
);
updateLoginTimeByUsername
(
username
);
insertLoginLog
(
username
);
...
...
mall-admin/src/main/resources/application-dev.properties
View file @
c3359c9f
#===datasource start===
spring.datasource.url
=
jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8
spring.datasource.url
=
jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8
&serverTimezone=GMT%2B8
spring.datasource.username
=
root
spring.datasource.password
=
root
#===datasource end===
...
...
mall-admin/src/main/resources/application.properties
View file @
c3359c9f
...
...
@@ -19,7 +19,7 @@ logging.level.com.macro.mall=debug
#===thymeleaf start===
spring.thymeleaf.mode
=
HTML5
spring.thymeleaf.encoding
=
UTF-8
spring.thymeleaf.content-type
=
text/html
spring.thymeleaf.
server.
content-type
=
text/html
#\u5F00\u53D1\u65F6\u5173\u95ED\u7F13\u5B58,\u4E0D\u7136\u6CA1\u6CD5\u770B\u5230\u5B9E\u65F6\u9875\u9762
spring.thymeleaf.cache
=
false
#===thymeleaf end==
...
...
mall-demo/pom.xml
View file @
c3359c9f
...
...
@@ -14,7 +14,7 @@
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.14
.RELEASE
</version>
<version>
2.1.3
.RELEASE
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
...
...
mall-demo/src/main/java/com/macro/mall/demo/config/SecurityConfig.java
View file @
c3359c9f
...
...
@@ -7,7 +7,6 @@ import com.macro.mall.model.UmsAdminExample;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.security.authentication.encoding.Md5PasswordEncoder
;
import
org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
;
...
...
@@ -15,6 +14,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.security.core.userdetails.UserDetailsService
;
import
org.springframework.security.core.userdetails.UsernameNotFoundException
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
java.util.List
;
...
...
@@ -58,7 +58,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected
void
configure
(
AuthenticationManagerBuilder
auth
)
throws
Exception
{
auth
.
userDetailsService
(
userDetailsService
()).
passwordEncoder
(
new
Md5
PasswordEncoder
());
auth
.
userDetailsService
(
userDetailsService
()).
passwordEncoder
(
new
BCrypt
PasswordEncoder
());
}
@Bean
...
...
mall-demo/src/main/resources/application.properties
View file @
c3359c9f
...
...
@@ -3,7 +3,7 @@ server.port=8082
#===server end===
#\u6570\u636E\u5E93\u8FDE\u63A5\u6C60\u914D\u7F6E
spring.datasource.url
=
jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8
spring.datasource.url
=
jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8
&serverTimezone=GMT%2B8
spring.datasource.username
=
root
spring.datasource.password
=
root
...
...
@@ -22,7 +22,7 @@ logging.level.com.macro.mall=debug
#thymeleaf start
spring.thymeleaf.mode
=
HTML5
spring.thymeleaf.encoding
=
UTF-8
spring.thymeleaf.content-type
=
text/html
spring.thymeleaf.
servlet.
content-type
=
text/html
#\u5F00\u53D1\u65F6\u5173\u95ED\u7F13\u5B58,\u4E0D\u7136\u6CA1\u6CD5\u770B\u5230\u5B9E\u65F6\u9875\u9762
spring.thymeleaf.cache
=
false
#thymeleaf end
...
...
mall-portal/pom.xml
View file @
c3359c9f
...
...
@@ -14,7 +14,7 @@
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.14
.RELEASE
</version>
<version>
2.1.3
.RELEASE
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
...
...
mall-portal/src/main/java/com/macro/mall/portal/config/SecurityConfig.java
View file @
c3359c9f
...
...
@@ -8,8 +8,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.security.authentication.encoding.Md5PasswordEncoder
;
import
org.springframework.security.authentication.encoding.PasswordEncoder
;
import
org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
;
...
...
@@ -17,6 +15,8 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.security.core.userdetails.UserDetailsService
;
import
org.springframework.security.core.userdetails.UsernameNotFoundException
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
/**
* SpringSecurity的配置
...
...
@@ -90,7 +90,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Bean
public
PasswordEncoder
passwordEncoder
()
{
return
new
Md5
PasswordEncoder
();
return
new
BCrypt
PasswordEncoder
();
}
@Bean
...
...
mall-portal/src/main/java/com/macro/mall/portal/config/TomcatConfig.java
View file @
c3359c9f
...
...
@@ -2,8 +2,7 @@ package com.macro.mall.portal.config;
import
org.apache.catalina.connector.Connector
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.context.embedded.EmbeddedServletContainerFactory
;
import
org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory
;
import
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Profile
;
...
...
@@ -18,8 +17,8 @@ public class TomcatConfig {
@Value
(
"${http.port}"
)
private
Integer
port
;
@Bean
public
EmbeddedServletContain
erFactory
servletContainer
()
{
Tomcat
EmbeddedServletContain
erFactory
tomcat
=
new
Tomcat
EmbeddedServletContain
erFactory
();
public
TomcatServletWebServ
erFactory
servletContainer
()
{
Tomcat
ServletWebServ
erFactory
tomcat
=
new
Tomcat
ServletWebServ
erFactory
();
tomcat
.
addAdditionalTomcatConnectors
(
createStandardConnector
());
// 添加http
return
tomcat
;
}
...
...
mall-portal/src/main/java/com/macro/mall/portal/service/impl/MemberReadHistoryServiceImpl.java
View file @
c3359c9f
...
...
@@ -34,7 +34,7 @@ public class MemberReadHistoryServiceImpl implements MemberReadHistoryService {
memberReadHistory
.
setId
(
id
);
deleteList
.
add
(
memberReadHistory
);
}
memberReadHistoryRepository
.
delete
(
deleteList
);
memberReadHistoryRepository
.
delete
All
(
deleteList
);
return
ids
.
size
();
}
...
...
mall-portal/src/main/java/com/macro/mall/portal/service/impl/OmsPortalOrderServiceImpl.java
View file @
c3359c9f
...
...
@@ -286,7 +286,9 @@ public class OmsPortalOrderServiceImpl implements OmsPortalOrderService {
orderItemExample
.
createCriteria
().
andOrderIdEqualTo
(
orderId
);
List
<
OmsOrderItem
>
orderItemList
=
orderItemMapper
.
selectByExample
(
orderItemExample
);
//解除订单商品库存锁定
if
(!
CollectionUtils
.
isEmpty
(
orderItemList
)){
portalOrderDao
.
releaseSkuStockLock
(
orderItemList
);
}
//修改优惠券使用状态
updateCouponStatus
(
cancelOrder
.
getCouponId
(),
cancelOrder
.
getMemberId
(),
0
);
//返还使用积分
...
...
mall-portal/src/main/java/com/macro/mall/portal/service/impl/UmsMemberServiceImpl.java
View file @
c3359c9f
...
...
@@ -12,10 +12,10 @@ import com.macro.mall.portal.service.RedisService;
import
com.macro.mall.portal.service.UmsMemberService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.security.authentication.encoding.PasswordEncoder
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.context.SecurityContext
;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
...
...
@@ -77,7 +77,7 @@ public class UmsMemberServiceImpl implements UmsMemberService {
UmsMember
umsMember
=
new
UmsMember
();
umsMember
.
setUsername
(
username
);
umsMember
.
setPhone
(
telephone
);
umsMember
.
setPassword
(
passwordEncoder
.
encode
Password
(
password
,
null
));
umsMember
.
setPassword
(
passwordEncoder
.
encode
(
password
));
umsMember
.
setCreateTime
(
new
Date
());
umsMember
.
setStatus
(
1
);
//获取默认会员等级并设置
...
...
@@ -118,7 +118,7 @@ public class UmsMemberServiceImpl implements UmsMemberService {
return
new
CommonResult
().
failed
(
"验证码错误"
);
}
UmsMember
umsMember
=
memberList
.
get
(
0
);
umsMember
.
setPassword
(
passwordEncoder
.
encode
Password
(
password
,
null
));
umsMember
.
setPassword
(
passwordEncoder
.
encode
(
password
));
memberMapper
.
updateByPrimaryKeySelective
(
umsMember
);
return
new
CommonResult
().
success
(
"密码修改成功"
,
null
);
}
...
...
mall-portal/src/main/resources/application-dev.properties
View file @
c3359c9f
...
...
@@ -14,7 +14,7 @@ logging.level.com.macro.mall.portal.dao=debug
#===logging end===
#===datasource start===
spring.datasource.url
=
jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8
spring.datasource.url
=
jdbc:mysql://localhost:3306/mall?useUnicode=true&characterEncoding=utf-8
&serverTimezone=GMT%2B8
spring.datasource.username
=
root
spring.datasource.password
=
root
#===datasource end===
...
...
@@ -49,15 +49,15 @@ spring.redis.port=6379
# Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09
spring.redis.password
=
# \u8FDE\u63A5\u6C60\u6700\u5927\u8FDE\u63A5\u6570\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09
spring.redis.pool.max-active
=
8
spring.redis.
jedis.
pool.max-active
=
8
# \u8FDE\u63A5\u6C60\u6700\u5927\u963B\u585E\u7B49\u5F85\u65F6\u95F4\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09
spring.redis.pool.max-wait
=
-1
spring.redis.
jedis.
pool.max-wait
=
-1
ms
# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5
spring.redis.pool.max-idle
=
8
spring.redis.
jedis.
pool.max-idle
=
8
# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5
spring.redis.pool.min-idle
=
0
spring.redis.
jedis.
pool.min-idle
=
0
# \u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09
spring.redis.timeout
=
0
spring.redis.timeout
=
0
ms
#===redis end===
#===rabbitMq start===
...
...
mall-portal/src/main/resources/application-prod.properties
View file @
c3359c9f
...
...
@@ -41,13 +41,13 @@ spring.redis.port=6379
# Redis\u670D\u52A1\u5668\u8FDE\u63A5\u5BC6\u7801\uFF08\u9ED8\u8BA4\u4E3A\u7A7A\uFF09
spring.redis.password
=
# \u8FDE\u63A5\u6C60\u6700\u5927\u8FDE\u63A5\u6570\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09
spring.redis.pool.max-active
=
8
spring.redis.
jedis.
pool.max-active
=
8
# \u8FDE\u63A5\u6C60\u6700\u5927\u963B\u585E\u7B49\u5F85\u65F6\u95F4\uFF08\u4F7F\u7528\u8D1F\u503C\u8868\u793A\u6CA1\u6709\u9650\u5236\uFF09
spring.redis.pool.max-wait
=
-1
spring.redis.
jedis.
pool.max-wait
=
-1
ms
# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5927\u7A7A\u95F2\u8FDE\u63A5
spring.redis.pool.max-idle
=
8
spring.redis.
jedis.
pool.max-idle
=
8
# \u8FDE\u63A5\u6C60\u4E2D\u7684\u6700\u5C0F\u7A7A\u95F2\u8FDE\u63A5
spring.redis.pool.min-idle
=
0
spring.redis.
jedis.
pool.min-idle
=
0
# \u8FDE\u63A5\u8D85\u65F6\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09
spring.redis.timeout
=
0
spring.redis.timeout
=
0
ms
#===redis end===
mall-search/pom.xml
View file @
c3359c9f
...
...
@@ -14,7 +14,7 @@
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.14
.RELEASE
</version>
<version>
2.1.3
.RELEASE
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment