60365ac67f82001b12cbfdc03f53b949
来自「jsf开发的简单博客」· 代码 · 共 23 行
TXT
23 行
package com.tangjun.model.service.impl;
import com.tangjun.model.exception.MyException;
import com.tangjun.model.service.IUserService;
public class UserServiceImpl implements IUserService {
public boolean login(String username, String password) throws MyException {
try {
User user=userDao.getUser(username);
if(user==null)
return null;
// 判断密码是否正确
if(!password.equals(user.getPassword()))
return null;
return user;
} catch (HibernateObjectRetrievalFailureException he) {
throw new UserException(username);
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?