|
@@ -6,11 +6,10 @@ import ieven.server.webapp.service.user.UserService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import javax.servlet.http.HttpSession;
|
|
|
|
|
|
-@RestController
|
|
|
@RequestMapping("")
|
|
|
public class UserController {
|
|
|
@Autowired UserService userService;
|
|
@@ -21,6 +20,7 @@ public class UserController {
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping("user/login")
|
|
|
+ @ResponseBody
|
|
|
public Mapped loginAccount(@RequestBody User user, HttpSession session) {
|
|
|
User user2 = userService.loginAccount(user);
|
|
|
if (user2 != null) {
|
|
@@ -36,6 +36,7 @@ public class UserController {
|
|
|
}
|
|
|
|
|
|
@RequestMapping("login/out")
|
|
|
+ @ResponseBody
|
|
|
public Mapped loginout(HttpSession session) {
|
|
|
session.invalidate();
|
|
|
return Mapped.OK();
|