|
|
@@ -2,10 +2,13 @@ package com.example.hotel.blImpl.user;
|
|
|
|
|
|
import com.example.hotel.bl.user.AccountService;
|
|
|
import com.example.hotel.data.user.AccountMapper;
|
|
|
+import com.example.hotel.po.User;
|
|
|
import com.example.hotel.vo.UserForm;
|
|
|
import com.example.hotel.vo.ResponseVO;
|
|
|
import com.example.hotel.vo.UserVO;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
@@ -28,10 +31,12 @@ public class AccountServiceImpl implements AccountService {
|
|
|
|
|
|
@Override
|
|
|
public UserVO login(UserForm userForm) {
|
|
|
- UserVO user = accountMapper.getAccountByName(userForm.getEmail());
|
|
|
+ UserVO userVO = new UserVO();
|
|
|
+ User user = accountMapper.getAccountByName(userForm.getEmail());
|
|
|
if (null == user || !user.getPassword().equals(userForm.getPassword())) {
|
|
|
return null;
|
|
|
}
|
|
|
- return user;
|
|
|
+ BeanUtils.copyProperties(user,userVO);
|
|
|
+ return userVO;
|
|
|
}
|
|
|
}
|