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