이 Grails 프로젝트에서 Spring Security 코어를 사용하고 있습니다. 나는 "비밀 번호"는 BootStrap 클래스에서 해결할 수없는 오류가 발생합니다.Grails 프로젝트에서 심볼을 확인할 수 없습니다.
나는이 도메인 클래스가 있습니다
class Person {
transient springSecurityService
String realName
String username
String password
boolean enabled
boolean accountExpired
boolean accountLocked
boolean passwordExpired
static constraints = {
username blank: false, unique: true
password blank: false
}
static mapping = {
password column: '`password`'
}
Set<Authority> getAuthorities() {
PersonAuthority.findAllByPerson(this).collect { it.authority } as Set
}
def beforeInsert() {
encodePassword()
}
def beforeUpdate() {
if (isDirty('password')) {
encodePassword()
}
}
protected void encodePassword() {
password = springSecurityService.encodePassword(password)
}
}
을이 내 BootsStrap 클래스입니다 :
class BootStrap {
def init = { servletContext ->
if (!Person.count()) {
createData()
}
}
def destroy = {
}
private void createData() {
def userRole = new Authority(authority: 'ROLE_USER').save()
[harry: 'Harry Brock'].each { userName, realName ->
def user = new Person(username: userName, realName: realName, password: password, enabled: true).save()
PersonAuthority.create user, userRole, true
}
}
}
내가 1.2.7.3
감사합니다. 암호를 암호로 설정하려고했습니다. 나는 이렇게했다 : password : "password" –