浏览代码

代码重构

tom.xu@informa.com 2 年之前
父节点
当前提交
f394861075
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      src/main/java/ieven/server/webapp/api/UserController.java

+ 3 - 4
src/main/java/ieven/server/webapp/api/UserController.java

@@ -4,7 +4,6 @@ import ieven.server.webapp.domain.user.User;
 import ieven.server.webapp.infrastructure.wrapper.Mapped;
 import ieven.server.webapp.service.user.UserService;
 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;
 import org.springframework.web.bind.annotation.RestController;
@@ -21,7 +20,7 @@ public class UserController {
    * @param user
    * @return
    */
-  @PostMapping("user/login")
+  @RequestMapping("user/login")
   public Mapped loginAccount(@RequestBody User user, HttpSession session) {
     User user2 = userService.loginAccount(user);
     if (user2 != null) {
@@ -31,12 +30,12 @@ public class UserController {
     return Mapped.ERROR("用户名或者密码错误!");
   }
 
-  @PostMapping("/")
+  @RequestMapping("/")
   public String index() {
     return "index";
   }
 
-  @PostMapping("login/out")
+  @RequestMapping("login/out")
   public Mapped loginout(HttpSession session) {
     session.invalidate();
     return Mapped.OK();