From 6286294686c3aa387bde0733b2c4d1e486f15d4a Mon Sep 17 00:00:00 2001 From: bseayin Date: Sat, 14 Sep 2019 20:51:05 +0800 Subject: [PATCH] authorization --- SpringBootShiroJWT/SpringBootShiroJWT.iml | 83 +++++++++++-------- .../shirojwt/controller/UserController.java | 5 +- .../src/main/resources/application.yml | 2 +- 3 files changed, 51 insertions(+), 39 deletions(-) diff --git a/SpringBootShiroJWT/SpringBootShiroJWT.iml b/SpringBootShiroJWT/SpringBootShiroJWT.iml index e753cc9..d1c3e93 100644 --- a/SpringBootShiroJWT/SpringBootShiroJWT.iml +++ b/SpringBootShiroJWT/SpringBootShiroJWT.iml @@ -25,9 +25,10 @@ - + + @@ -35,7 +36,30 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -52,32 +76,28 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + @@ -91,15 +111,6 @@ - - - - - - - - - - + \ No newline at end of file diff --git a/SpringBootShiroJWT/src/main/java/com/example/shirojwt/controller/UserController.java b/SpringBootShiroJWT/src/main/java/com/example/shirojwt/controller/UserController.java index 397bc8e..c9a69bd 100644 --- a/SpringBootShiroJWT/src/main/java/com/example/shirojwt/controller/UserController.java +++ b/SpringBootShiroJWT/src/main/java/com/example/shirojwt/controller/UserController.java @@ -9,6 +9,7 @@ import com.example.shirojwt.result.ResponseDataUtil; import com.example.shirojwt.service.UserService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -29,7 +30,7 @@ public class UserController { @Autowired private UserService userService; - @RequestMapping("/login") + @PostMapping("/login") public Object login(@RequestBody User user) { log.warn("执行登录操作!"); //先执行登录验证的过滤操作,才会执行后面这些乱七八糟的异常 @@ -44,7 +45,7 @@ public class UserController { @RequestMapping("/test") public Object test(@RequestBody User user) { log.warn("测试拦截的方法能进来不?"); - return "测试拦截的方法能进来不?"; + return "测试拦截的方法能进来不?成功进来了"; } @RequestMapping("/swagger/test") diff --git a/SpringBootShiroJWT/src/main/resources/application.yml b/SpringBootShiroJWT/src/main/resources/application.yml index bde6bf0..fa37812 100644 --- a/SpringBootShiroJWT/src/main/resources/application.yml +++ b/SpringBootShiroJWT/src/main/resources/application.yml @@ -6,7 +6,7 @@ spring: # mysql8用下面的这个驱动 driver-class-name: com.mysql.cj.jdbc.Driver username: root - password: DBhome20190911 + password: Java20190713*yy url: jdbc:mysql://localhost/java10?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&useSSL=false&allowMultiQueries=true&allowPublicKeyRetrieval=true #日志级别