travel/service/app/model/Admins.php

20 lines
400 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;
}
}