Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
学习是不可能停的
micro-service-skeleton
提交
0105f00f
M
micro-service-skeleton
项目概览
学习是不可能停的
/
micro-service-skeleton
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
micro-service-skeleton
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0105f00f
编写于
10月 29, 2020
作者:
M
ManongJu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
动态权限校验
上级
746749e5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
45 addition
and
18 deletion
+45
-18
mss-gateway/src/main/java/com/microservice/skeleton/gateway/filter/AuthFilter.java
.../com/microservice/skeleton/gateway/filter/AuthFilter.java
+4
-2
mss-gateway/src/main/resources/application.yml
mss-gateway/src/main/resources/application.yml
+3
-2
mss-upms/src/main/java/com/microservice/skeleton/upms/controller/TestController.java
...microservice/skeleton/upms/controller/TestController.java
+24
-0
other/db/zuul-auth.sql
other/db/zuul-auth.sql
+14
-10
pom.xml
pom.xml
+0
-4
未找到文件。
mss-gateway/src/main/java/com/microservice/skeleton/gateway/filter/AuthFilter.java
浏览文件 @
0105f00f
...
...
@@ -89,12 +89,11 @@ public class AuthFilter implements GlobalFilter , Ordered {
}
private
boolean
isExclusionUrl
(
String
path
){
final
String
url
=
getRealUrl
(
path
);
List
<
String
>
exclusions
=
exclusionUrl
.
getUrl
();
if
(
exclusions
.
size
()
==
0
){
return
false
;
}
return
exclusions
.
stream
().
anyMatch
(
action
->
antPathMatcher
.
match
(
action
,
url
));
return
exclusions
.
stream
().
anyMatch
(
action
->
antPathMatcher
.
match
(
action
,
path
));
}
...
...
@@ -123,6 +122,9 @@ public class AuthFilter implements GlobalFilter , Ordered {
private
boolean
hasPermission
(
String
headerToken
,
String
path
){
String
url
=
getRealUrl
(
path
);
try
{
if
(
StringUtils
.
isEmpty
(
headerToken
)){
return
false
;
}
SignedJWT
jwt
=
getSignedJWT
(
headerToken
);
Object
payload
=
jwt
.
getJWTClaimsSet
().
getClaim
(
"payload"
);
UserVo
user
=
JSON
.
parseObject
(
payload
.
toString
(),
UserVo
.
class
);
...
...
mss-gateway/src/main/resources/application.yml
浏览文件 @
0105f00f
...
...
@@ -37,5 +37,6 @@ hystrix:
timeoutInMilliseconds
:
600000
exclusion
:
url
:
-
/goods/list
-
/goods/detail
\ No newline at end of file
-
/goods-center/goods/list
-
/goods-center/goods/detail
-
/uaa/login
\ No newline at end of file
mss-upms/src/main/java/com/microservice/skeleton/upms/controller/TestController.java
0 → 100644
浏览文件 @
0105f00f
package
com.microservice.skeleton.upms.controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author Mr.Yangxiufeng
* @date 2020-10-29
* @time 16:32
*/
@RestController
@RequestMapping
(
"order"
)
public
class
TestController
{
@GetMapping
(
"list"
)
public
String
orderList
(){
return
"order list"
;
}
@GetMapping
(
"detail"
)
public
String
orderDetail
(){
return
"order detail"
;
}
}
other/db/zuul-auth.sql
浏览文件 @
0105f00f
...
...
@@ -10,7 +10,7 @@ Target Server Type : MYSQL
Target Server Version : 50628
File Encoding : 65001
Date: 20
18-12-07 17:26:38
Date: 20
20-10-29 16:47:06
*/
SET
FOREIGN_KEY_CHECKS
=
0
;
...
...
@@ -164,11 +164,14 @@ CREATE TABLE `sys_menu` (
`update_time`
datetime
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`FK_CODE`
(
`code`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
4
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Records of sys_menu
-- ----------------------------
INSERT
INTO
`sys_menu`
VALUES
(
'1'
,
'order'
,
null
,
null
,
'订单管理'
,
null
,
'1'
,
null
,
null
,
null
,
null
,
null
,
null
);
INSERT
INTO
`sys_menu`
VALUES
(
'2'
,
'order_list'
,
'order'
,
'1'
,
'订单列表查询'
,
'/order/list'
,
'2'
,
null
,
null
,
null
,
null
,
null
,
null
);
INSERT
INTO
`sys_menu`
VALUES
(
'3'
,
'order_detail'
,
'order'
,
'1'
,
'订单详情'
,
'/order/detail'
,
'2'
,
null
,
null
,
null
,
null
,
null
,
null
);
-- ----------------------------
-- Table structure for sys_privilege
...
...
@@ -184,6 +187,9 @@ CREATE TABLE `sys_privilege` (
-- ----------------------------
-- Records of sys_privilege
-- ----------------------------
INSERT
INTO
`sys_privilege`
VALUES
(
'6'
,
'1'
,
null
);
INSERT
INTO
`sys_privilege`
VALUES
(
'6'
,
'2'
,
null
);
INSERT
INTO
`sys_privilege`
VALUES
(
'6'
,
'3'
,
null
);
-- ----------------------------
-- Table structure for sys_role
...
...
@@ -205,9 +211,7 @@ CREATE TABLE `sys_role` (
-- ----------------------------
-- Records of sys_role
-- ----------------------------
INSERT
INTO
`sys_role`
VALUES
(
'6'
,
'管理员'
,
'admin'
,
null
,
'2017-06-20 15:07:13'
,
'2017-06-26 12:46:09'
,
'1'
);
INSERT
INTO
`sys_role`
VALUES
(
'8'
,
'超级管理员'
,
'super'
,
null
,
'2017-06-20 15:08:45'
,
null
,
'1'
);
INSERT
INTO
`sys_role`
VALUES
(
'17'
,
'用户'
,
'user'
,
null
,
'2017-06-28 18:50:39'
,
'2017-07-21 09:41:28'
,
'1'
);
INSERT
INTO
`sys_role`
VALUES
(
'6'
,
'管理员'
,
'admin'
,
null
,
'2020-10-28 15:07:13'
,
null
,
'1'
);
-- ----------------------------
-- Table structure for sys_user
...
...
@@ -234,10 +238,9 @@ CREATE TABLE `sys_user` (
-- ----------------------------
-- Records of sys_user
-- ----------------------------
INSERT
INTO
`sys_user`
VALUES
(
'46'
,
null
,
'super'
,
'$2a$10$cKRbR9IJktfmKmf/wShyo.5.J8IxO/7YVn8twuWFtvPgruAF8gtKq'
,
null
,
'超级管理员'
,
'2017-06-22 14:26:09'
,
'1'
,
null
,
null
,
'1'
,
'2017-06-20 15:12:16'
,
'2017-09-12 14:39:48'
);
INSERT
INTO
`sys_user`
VALUES
(
'48'
,
null
,
'admin'
,
'$2a$10$cKRbR9IJktfmKmf/wShyo.5.J8IxO/7YVn8twuWFtvPgruAF8gtKq'
,
null
,
'管理员'
,
null
,
'1'
,
null
,
null
,
'1'
,
'2017-06-26 17:31:41'
,
null
);
INSERT
INTO
`sys_user`
VALUES
(
'50'
,
null
,
'test1'
,
'$2a$10$cKRbR9IJktfmKmf/wShyo.5.J8IxO/7YVn8twuWFtvPgruAF8gtKq'
,
null
,
'test1'
,
null
,
'1'
,
null
,
null
,
'1'
,
'2017-09-18 16:11:15'
,
null
);
INSERT
INTO
`sys_user`
VALUES
(
'51'
,
null
,
'test2'
,
'$2a$10$cKRbR9IJktfmKmf/wShyo.5.J8IxO/7YVn8twuWFtvPgruAF8gtKq'
,
null
,
'test2'
,
null
,
'1'
,
null
,
null
,
'1'
,
'2017-09-21 17:09:51'
,
null
);
INSERT
INTO
`sys_user`
VALUES
(
'48'
,
null
,
'admin'
,
'$2a$10$vmp.zWWnX3LFxSs6I00i0eurlHR7ymcfUQ5HtXw71w9QJ.2JUf8Ua'
,
null
,
'管理员'
,
null
,
'1'
,
null
,
null
,
'1'
,
'2020-10-27 17:31:41'
,
null
);
INSERT
INTO
`sys_user`
VALUES
(
'50'
,
null
,
'test1'
,
'$2a$10$vmp.zWWnX3LFxSs6I00i0eurlHR7ymcfUQ5HtXw71w9QJ.2JUf8Ua'
,
null
,
'test1'
,
null
,
'1'
,
null
,
null
,
'1'
,
'2020-10-27 16:11:15'
,
null
);
INSERT
INTO
`sys_user`
VALUES
(
'51'
,
null
,
'test2'
,
'$2a$10$vmp.zWWnX3LFxSs6I00i0eurlHR7ymcfUQ5HtXw71w9QJ.2JUf8Ua'
,
null
,
'test2'
,
null
,
'1'
,
null
,
null
,
'1'
,
'2020-10-27 17:09:51'
,
null
);
-- ----------------------------
-- Table structure for sys_user_role
...
...
@@ -250,8 +253,9 @@ CREATE TABLE `sys_user_role` (
`create_time`
datetime
DEFAULT
NULL
,
`create_by`
varchar
(
255
)
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
2
4
DEFAULT
CHARSET
=
utf8
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
2
DEFAULT
CHARSET
=
utf8
;
-- ----------------------------
-- Records of sys_user_role
-- ----------------------------
INSERT
INTO
`sys_user_role`
VALUES
(
'1'
,
'48'
,
'6'
,
null
,
null
);
pom.xml
浏览文件 @
0105f00f
...
...
@@ -21,10 +21,6 @@
<swagger2.version>
2.9.2
</swagger2.version>
<mybatis-plus.version>
2.2.0
</mybatis-plus.version>
<tk.mybatis.starter.version>
2.0.4
</tk.mybatis.starter.version>
<!--升级SpringBoot2.0.x后出现Which fixed NoSuchMethodError.RedisConnection.set([B[B)V issue
,需要解决https://github.com/spring-projects/spring-security-oauth2-boot/issues/27,
SpringBoot2.1.X已经解决,真是坑啊,所以说不要盲目的升级!!!-->
<spring-security-oauth.version>
2.3.3.RELEASE
</spring-security-oauth.version>
<com.spotify-version>
0.4.13
</com.spotify-version>
</properties>
<parent>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录