|
@@ -23,6 +23,22 @@ public class UserController {
|
|
|
@Autowired
|
|
|
private UserService userService;
|
|
|
|
|
|
+ /**
|
|
|
+ * 登录demo做测试,后续删除
|
|
|
+ * @param vo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/login",method = RequestMethod.POST)
|
|
|
+ public BaseResult<UserDTO> login(@Valid LoginVO vo){
|
|
|
+ vo.setPassword(MD5Utils.encoderMD5(vo.getPassword()));
|
|
|
+ UserDTO user = userService.getUserByUserName(vo);
|
|
|
+ if(user!=null){
|
|
|
+ return BaseResult.success(user);
|
|
|
+ }else{
|
|
|
+ return BaseResult.fail(ResultEnum.LOGIN_ERROR);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@RequestMapping(value = "/find",method = RequestMethod.POST)
|
|
|
@PreAuthorize(value = "isAuthenticated()")//需要登录才可以访问
|
|
|
public BaseResult<?> find(){
|