1.增加谷歌验证器
This commit is contained in:
@@ -21,6 +21,8 @@ use support\think\Db;
|
||||
* @property string $password 密码密文
|
||||
* @property string $salt 密码盐
|
||||
* @property string $status 状态:enable=启用,disable=禁用
|
||||
* @property string $totp_secret TOTP密钥(加密)
|
||||
* @property int $totp_bind_time TOTP绑定时间
|
||||
*/
|
||||
class Admin extends Model
|
||||
{
|
||||
@@ -43,8 +45,18 @@ class Admin extends Model
|
||||
protected array $append = [
|
||||
'group_arr',
|
||||
'group_name_arr',
|
||||
'totp_bound',
|
||||
];
|
||||
|
||||
protected array $hidden = [
|
||||
'totp_secret',
|
||||
];
|
||||
|
||||
public function getTotpBoundAttr($value, $row): bool
|
||||
{
|
||||
return \app\common\library\AdminTotp::isBound($row['totp_secret'] ?? '');
|
||||
}
|
||||
|
||||
public function getGroupArrAttr($value, $row): array
|
||||
{
|
||||
return Db::name('admin_group_access')
|
||||
|
||||
Reference in New Issue
Block a user