|
|
|
@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
|
|
|
|
|
|
import vip.xumy.core.pojo.com.BaseResponse; |
|
|
|
|
import vip.xumy.core.utils.StringUtil; |
|
|
|
|
import vip.xumy.idle.server.pojo.SocketMsg; |
|
|
|
|
import vip.xumy.idle.server.pojo.User; |
|
|
|
|
import vip.xumy.idle.server.service.UserService; |
|
|
|
@ -37,7 +38,7 @@ public class PublicController {
@@ -37,7 +38,7 @@ public class PublicController {
|
|
|
|
|
WebSocketService.sendMessage(new SocketMsg<String>("update", notify)); |
|
|
|
|
return new BaseResponse(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("login") |
|
|
|
|
public BaseResponse login(@RequestBody User param) { |
|
|
|
|
User user = userService.login(param); |
|
|
|
@ -47,10 +48,13 @@ public class PublicController {
@@ -47,10 +48,13 @@ public class PublicController {
|
|
|
|
|
LoginUtil.saveLoginInfo(user); |
|
|
|
|
return new BaseResponse(user); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("login") |
|
|
|
|
public BaseResponse getLogin() { |
|
|
|
|
User user = LoginUtil.getUserInfo(); |
|
|
|
|
if (StringUtil.isEmpty(user.getUsername())) { |
|
|
|
|
return new BaseResponse(null); |
|
|
|
|
} |
|
|
|
|
return new BaseResponse(user); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|