src/main/java/suwu/daopuerp/bl/account/AccountBlServiceImpl.java
/**
     * Login with username and password provided.
     *
     * @param username username
     * @param password password
     * @return EmployeeVo is login is successful
     */
Login with username and password provided.
@param username username
@param password password
@return EmployeeVo is login is successful
Login with username and password provided . @param username username @param password password @return EmployeeVo is login is successful
@Override
    public UserDto login(String username, String password) throws PasswordWrongException, UserDoesNotExistException {
        try {
            User user = accountDataService.getUserByUsername(username);
            if (!user.getPassword().equals(password)) {
                throw new PasswordWrongException();
            } else {
                return new UserDto(user.getUsername());
            }
        } catch (UserDoesNotExistException e) {
            e.printStackTrace();
            throw new UserDoesNotExistException();
        }
    }
@ Override public UserDto login ( String username , String password ) throws PasswordWrongException , UserDoesNotExistException { try { User user = accountDataService . getUserByUsername ( username ) ; if ( ! user . getPassword ( ) . equals ( password ) ) { throw new PasswordWrongException ( ) ; } else { return new UserDto ( user . getUsername ( ) ) ; } } catch ( UserDoesNotExistException e ) { e . printStackTrace ( ) ; throw new UserDoesNotExistException ( ) ; } }
Login with username and password provided.
Login with username and password provided .