*/
@Override
public void saveOrUpdate(User user) {
if (user.getId() == null) {
if (userDAO.getByUsername(user.getUsername()) != null) {
throw new ExistedException("登录名:" + user.getUsername() + "已存在。");
}
//设定安全的密码,使用passwordService提供的salt并经过1024次 sha-1 hash
if (StringUtils.isNotBlank(user.getPlainPassword()) && shiroRealm != null) {
HashPassword hashPassword = ShiroDbRealm.encryptPassword(user.getPlainPassword());