use yml
This commit is contained in:
@@ -46,6 +46,9 @@ func (a *Account) SetPassword(password string) error {
|
||||
// 验证登录帐户密码合法性
|
||||
func (a *Account) CheckPassword() bool {
|
||||
password := a.Password
|
||||
|
||||
aa, err1 := bcrypt.GenerateFromPassword([]byte(a.Password), 12)
|
||||
print(aa, err1)
|
||||
DB.Where("username = ?", a.Username).First(&a)
|
||||
err := bcrypt.CompareHashAndPassword([]byte(a.Password), []byte(password))
|
||||
return err == nil
|
||||
|
||||
Reference in New Issue
Block a user