travel/service/app/model/Admins.php

20 lines
400 B
PHP
Raw Normal View History

2024-06-24 11:52:30 +08:00
<?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;
}
2024-06-24 20:58:23 +08:00
2024-06-24 11:52:30 +08:00
}