class Pam

账号操作

Traits

用户设置和获取
AppTrait

Pam Trait Pam 的验证, 设置, 获取

Properties

protected Resp $error error from  AppTrait
protected Resp $success success from  AppTrait
protected $pam from  PamTrait

Methods

array|mixed
userSettingGet(int $account_id, string $key)

根据 用户ID获取配置

bool
userSettingSet(int $account_id, string $key, array $values, array $available = [])

No description

getError()

获取错误

from  AppTrait
bool
setError(string|MessageBag $error)

设置错误

from  AppTrait
getSuccess()

Get success messages;

from  AppTrait
bool
setSuccess(Resp|string $success)

No description

from  AppTrait
getPam()

No description

from  PamTrait
$this|PamTrait
setPam(PamAccount|Authenticatable|int $pam)

Set Pam Account.

from  PamTrait
bool
checkPam()

检查 pam 用户

from  PamTrait
bool
checkPermission(string $permission_key)

检测当前用户是否存在权限

from  PamTrait
bool
getIsRegister()

No description

bool
captchaLogin(string $passport, string $captcha, string $guard)

验证验登录

bool
beCaptchaLogin(string $mobile, string $captcha)

后台验证码登录

void
setParentId(int $parent_id)

设置父级ID

bool
register(string $passport, string $password = '', string|array|int $role_name = PamRole::FE_USER)

用户注册

bool
loginCheck(string $passport, string $password, string $guard_name = PamAccount::GUARD_WEB)

密码登录

bool
setPassword(PamAccount $pam, string $password)

设置登录密码

bool
clearMobile(int $id)

清空后台登录用户的手机通行证

bool
setMobile(PamAccount $pam, string $mobile)

设置后台登录用户的手机通行证

void
setNote(PamAccount $pam, string $note)

设置备注

bool
setRoles(PamAccount|mixed $pam, array $roles)

设置角色

array
passportData(array|Request $credentials)

生成支持 passport 格式的数组

bool
rebind(string|numeric-string|int|float|PamAccount $old_passport, string $new_passport)

更换账号主体, 支持除非ID外的更换方式

bool
disable(int $id, string $to, string $reason)

后台用户禁用

bool
enable(int $id, string $reason = '')

后台用户启用

bool
autoEnable()

自动解禁

void
logout()

No description

bool
clearLog()

清除登录日志

bool
changePassword(string $old_password, string $password)

修改密码

bool
checkPwdStrength($type, $password)

No description

bool
checkIsEnable(PamAccount $pam)

验证用户权限

Details

in UserSettingTrait at line 20
array|mixed userSettingGet(int $account_id, string $key)

根据 用户ID获取配置

Parameters

int $account_id
string $key

Return Value

array|mixed

in UserSettingTrait at line 33
bool userSettingSet(int $account_id, string $key, array $values, array $available = [])

No description

Parameters

int $account_id
string $key key
array $values
array $available 数组

Return Value

bool

in AppTrait at line 32
Resp getError()

获取错误

Return Value

Resp

in AppTrait at line 45
bool setError(string|MessageBag $error)

设置错误

Parameters

string|MessageBag $error error

Return Value

bool

in AppTrait at line 82
Resp getSuccess()

Get success messages;

Return Value

Resp

in AppTrait at line 100
bool setSuccess(Resp|string $success)

No description

Parameters

Resp|string $success 设置的成功信息

Return Value

bool

in PamTrait at line 25
PamAccount getPam()

No description

Return Value

PamAccount

in PamTrait at line 36
$this|PamTrait setPam(PamAccount|Authenticatable|int $pam)

Set Pam Account.

Parameters

PamAccount|Authenticatable|int $pam 用户

Return Value

$this|PamTrait

in PamTrait at line 52
bool checkPam()

检查 pam 用户

Return Value

bool

in PamTrait at line 66
bool checkPermission(string $permission_key)

检测当前用户是否存在权限

Parameters

string $permission_key 权限KEY

Return Value

bool

at line 60
bool getIsRegister()

No description

Return Value

bool

at line 73
bool captchaLogin(string $passport, string $captcha, string $guard)

验证验登录

Parameters

string $passport 通行证
string $captcha 验证码
string $guard

认证 Guard

Return Value

bool

Exceptions

Throwable

at line 125
bool beCaptchaLogin(string $mobile, string $captcha)

后台验证码登录

Parameters

string $mobile 通行证
string $captcha 验证码

Return Value

bool

at line 157
void setParentId(int $parent_id)

设置父级ID

Parameters

int $parent_id 父级id

Return Value

void

at line 170
bool register(string $passport, string $password = '', string|array|int $role_name = PamRole::FE_USER)

用户注册

Parameters

string $passport passport
string $password 密码
string|array|int $role_name 用户角色名称

Return Value

bool

Exceptions

Throwable

at line 319
bool loginCheck(string $passport, string $password, string $guard_name = PamAccount::GUARD_WEB)

密码登录

Parameters

string $passport passport
string $password 密码
string $guard_name 类型

Return Value

bool

Exceptions

ApplicationException

at line 384
bool setPassword(PamAccount $pam, string $password)

设置登录密码

Parameters

PamAccount $pam 用户
string $password 密码

Return Value

bool

at line 421
bool clearMobile(int $id)

清空后台登录用户的手机通行证

Parameters

int $id

Return Value

bool

at line 440
bool setMobile(PamAccount $pam, string $mobile)

设置后台登录用户的手机通行证

Parameters

PamAccount $pam 用户
string $mobile 密码

Return Value

bool

at line 480
void setNote(PamAccount $pam, string $note)

设置备注

Parameters

PamAccount $pam
string $note

Return Value

void

at line 492
bool setRoles(PamAccount|mixed $pam, array $roles)

设置角色

Parameters

PamAccount|mixed $pam 账号数据
array $roles 角色名

Return Value

bool

at line 507
array passportData(array|Request $credentials)

生成支持 passport 格式的数组

Parameters

array|Request $credentials 待转化的数据

Return Value

array

at line 531
bool rebind(string|numeric-string|int|float|PamAccount $old_passport, string $new_passport)

更换账号主体, 支持除非ID外的更换方式

Parameters

string|numeric-string|int|float|PamAccount $old_passport
string $new_passport

Return Value

bool

at line 565
bool disable(int $id, string $to, string $reason)

后台用户禁用

Parameters

int $id 用户id
string $to 解禁时间
string $reason 禁用原因

Return Value

bool

at line 616
bool enable(int $id, string $reason = '')

后台用户启用

Parameters

int $id 用户Id
string $reason 原因

Return Value

bool

at line 637
bool autoEnable()

自动解禁

Return Value

bool

at line 658
void logout()

No description

Return Value

void

Exceptions

Throwable

at line 669
bool clearLog()

清除登录日志

Return Value

bool

Exceptions

Exception

at line 688
bool changePassword(string $old_password, string $password)

修改密码

Parameters

string $old_password 老密码
string $password 新密码

Return Value

bool

at line 707
bool checkPwdStrength($type, $password)

No description

Parameters

$type
$password

Return Value

bool

at line 730
bool checkIsEnable(PamAccount $pam)

验证用户权限

Parameters

PamAccount $pam 用户

Return Value

bool