19 lines
399 B
PHP
19 lines
399 B
PHP
<?php
|
|
namespace app\model;
|
|
|
|
class Admins extends base
|
|
{
|
|
|
|
//设置密码
|
|
public function setPasswordAttr($pwd) {
|
|
return password_hash($pwd, PASSWORD_DEFAULT);
|
|
}
|
|
|
|
public function checkPwd($pwd) {
|
|
if(empty($pwd) || empty($this->password)) return false;
|
|
if(password_verify($pwd, $this->password)) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
} |