Properties

$instance

$instance

$_error

$_error

$_logined

$_logined

$_user

$_user

$_token

$_token

$keeptime

$keeptime

$config

$config

$options

$options

$allowFields

$allowFields

Methods

__construct()

__construct(mixed  $options = []) : mixed

Parameters

mixed $options

Returns

mixed —

instance()

instance(array  $options = []) : static

获取示例

Parameters

array $options

实例配置

Returns

static —

getUser()

getUser() : \app\member\service\User

获取User模型

Returns

\app\member\service\User —

__get()

__get(string  $name) : mixed

兼容调用user模型的属性

Parameters

string $name

Returns

mixed —

__isset()

__isset(mixed  $name) : mixed

兼容调用user模型的属性

Parameters

mixed $name

Returns

mixed —

init()

init(string  $token) : bool

根据Token初始化

Parameters

string $token

Token

Returns

bool —

userRegister()

userRegister( $username,  $password, string  $email = '', string  $mobile = '', array  $extend = []) : bool|mixed

注册一个新用户

Parameters

$username

用户名

$password

密码

string $email

邮箱

string $mobile

手机号

array $extend

扩展参数

Returns

bool|mixed —

loginLocal()

loginLocal( $account,  $password = null) : bool

会员登录

Parameters

$account

账户

$password

明文密码,填写表示验证密码

Returns

bool —

delete()

delete(int  $user_id) : bool

删除一个指定会员

Parameters

int $user_id

会员ID

Returns

bool —

direct()

direct(int  $user_id) : bool

直接登录账号

Parameters

int $user_id

Returns

bool —

changepwd()

changepwd(string  $newpassword, string  $oldpassword = '', bool  $ignoreoldpassword = false) : bool

修改密码

Parameters

string $newpassword

新密码

string $oldpassword

旧密码

bool $ignoreoldpassword

忽略旧密码

Returns

bool —

getUserinfo()

getUserinfo() : mixed

获取会员基本信息

Returns

mixed —

get_usergroup_bypoint()

get_usergroup_bypoint(int  $point) : int|string|null

根据积分算出用户组

Parameters

int $point

积分数

Returns

int|string|null —

isLogin()

isLogin() : mixed

检验用户是否已经登陆

Returns

mixed —

getAllowFields()

getAllowFields() : array

获取允许输出的字段

Returns

array —

setAllowFields()

setAllowFields(array  $fields) : mixed

设置允许输出的字段

Parameters

array $fields

Returns

mixed —

getToken()

getToken() : string

获取当前Token

Returns

string —

keeptime()

keeptime(int  $keeptime) : mixed

设置会话有效时间

Parameters

int $keeptime

默认为永久

Returns

mixed —

logout()

logout() : bool

注销登录状态

Returns

bool —

match()

match(array  $arr = []) : bool

检测当前控制器和方法是否匹配传递的数组

Parameters

array $arr

需要验证权限的数组

Returns

bool —

getConfig()

getConfig() : mixed

Returns

mixed —

setError()

setError( $error) : \app\member\service\Auth

设置错误信息

Parameters

$error

错误信息

Returns

\app\member\service\Auth —

getError()

getError() : \app\member\service\type

获取错误信息

Returns

\app\member\service\type —