(package) new CurrentUser(attribute)
Parameters:
Name | Type | Description |
---|---|---|
attribute |
Object | 用户信息 |
- Source:
Extends
Methods
append(key, value) → {this}
数组添加元素。
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
value |
string | 值 |
- Overrides:
- Source:
Returns:
- Type
- this
get(key) → {any}
获取某一项用户信息
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 用户信息 key |
- Source:
Returns:
用户信息
- Type
- any
incrementBy(key, value) → {this}
自增(原子操作)。
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
value |
number | 值 |
- Overrides:
- Source:
Returns:
- Type
- this
linkAlipay(optionsopt) → {Promise.<this>}
将支付宝账号绑定到当前用户,匿名用户无法调用
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
BaaS.LinkAlipayParams |
<optional> |
参数 |
- Source:
Returns:
UserRecord 实例
- Type
- Promise.<this>
linkBaidu(authDataopt, paramsopt) → {Promise.<this>}
将百度账号绑定到当前用户,匿名用户无法调用
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
authData |
BaaS.AuthData | null |
<optional> |
用户信息 |
params |
BaaS.LinkOptions |
<optional> |
用户信息参数 |
- Source:
Returns:
[UserRecord] 实例
- Type
- Promise.<this>
linkJd(optionsopt) → {Promise.<this>}
将京东账号绑定到当前用户,匿名用户无法调用
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
BaaS.LinkOptions |
<optional> |
参数 |
- Source:
Returns:
UserRecord 实例
- Type
- Promise.<this>
linkQQ(authDataopt, paramsopt) → {Promise.<this>}
将 QQ 账号绑定到当前用户,匿名用户无法调用
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
authData |
BaaS.AuthData | null |
<optional> |
用户信息 |
params |
BaaS.LinkOptions |
<optional> |
用户信息参数 |
- Source:
Returns:
UserRecord 实例
- Type
- Promise.<this>
linkThirdParty(providor, authPageUrl, optionsopt) → {Promise.<this>}
将第三方账号绑定到当前用户,匿名用户无法调用
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
providor |
string | 第三方平台 | |
authPageUrl |
string | 授权页面 URL | |
options |
BaaS.LinkThirdPartyParams |
<optional> |
其他选项 |
- Since:
- v2.1.0
- Source:
Returns:
UserRecord 实例
- Type
- Promise.<this>
linkThirdPartyWithAuthData(authData, optionsopt) → {Promise.<this>}
将第三方账号绑定到当前用户(使用 auth_data 绑定),匿名用户无法调用
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
authData |
BaaS.LinkAuthDataAuthData | 授权页面 URL | |
options |
BaaS.LinkAuthDataOptions |
<optional> |
其他选项 |
- Since:
- v3.13.0
- Source:
Returns:
UserRecord 实例
- Type
- Promise.<this>
linkTt(optionsopt) → {Promise.<this>}
将字节跳动账号绑定到当前用户,匿名用户无法调用
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
options |
BaaS.LinkBytedanceParams |
<optional> |
参数 |
- Source:
Returns:
UserRecord 实例
- Type
- Promise.<this>
linkWechat(authDataopt, paramsopt) → {Promise.<this>}
将微信账号绑定到当前用户,匿名用户无法调用
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
authData |
BaaS.AuthData | null |
<optional> |
用户信息 |
params |
BaaS.LinkWechatOptions |
<optional> |
用户信息参数 |
- Source:
Returns:
UserRecord 实例
- Type
- Promise.<this>
patchObject(key, value) → {this}
Object 类型字段修改。
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
value |
object | 值 |
- Overrides:
- Source:
Returns:
- Type
- this
pop(key) → {this}
Array 类型字段修改,移除数组末位元素。
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
- Overrides:
- Source:
Returns:
- Type
- this
remove(key, value) → {this}
数组移除元素。
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
value |
string | 值 |
- Overrides:
- Source:
Returns:
- Type
- this
requestEmailVerification() → {Promise.<this>}
发送验证邮件
- Source:
Returns:
UserRecord 实例
- Type
- Promise.<this>
setAccount(accountInfo) → {Promise.<this>}
初次设置账号信息
Parameters:
Name | Type | Description |
---|---|---|
accountInfo |
BaaS.SetAccountParmas |
- Source:
Returns:
UserRecord 实例
- Type
- Promise.<this>
setEmail(email, optionsopt) → {Promise.<this>}
更新邮箱
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
email |
string | null | email 地址 | |
options |
SetEmailOptions |
<optional> |
可选参数 |
- Source:
Returns:
UserRecord 实例
- Type
- Promise.<this>
setMobilePhone(phone) → {Promise.<this>}
更改手机号
Parameters:
Name | Type | Description |
---|---|---|
phone |
string | null | 手机号码 |
- Source:
Returns:
UserRecord 实例
- Type
- Promise.<this>
set(particialRecord) → {this}
批量给字段赋值
Parameters:
Name | Type | Description |
---|---|---|
particialRecord |
Object.<string, any> | 由字段名称与值组成的键值对对象 |
- Overrides:
- Source:
Returns:
- Type
- this
setUsername(username) → {Promise.<this>}
更新用户名
Parameters:
Name | Type | Description |
---|---|---|
username |
string | null | 用户名 |
- Source:
Returns:
UserRecord 实例
- Type
- Promise.<this>
shift(key) → {this}
Array 类型字段修改,移除数组首位元素。
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
- Overrides:
- Source:
Returns:
- Type
- this
toJSON() → {Object}
以 JSON Object 的形式返回用户信息
- Source:
Returns:
用户信息
- Type
- Object
uAppend(key, value) → {this}
数组添加元素(原子操作)。
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
value |
Array.<string> | string | 值 |
- Overrides:
- Source:
Returns:
- Type
- this
unset(key) → {this}
移除字段
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
- Overrides:
- Source:
Returns:
- Type
- this
unset(particialRecord) → {this}
批量移除字段
Parameters:
Name | Type | Description |
---|---|---|
particialRecord |
Object.<string, any> | 由字段名称与值组成的键值对对象, 接口会忽略 Object 里所有的 value,参照所有的 key 来执行移除操作。 |
- Overrides:
- Source:
Returns:
- Type
- this
update() → {Promise.<Response.<any>>}
更新用户数据。
- Overrides:
- Source:
Returns:
- Type
- Promise.<Response.<any>>
updatePassword(options) → {Promise.<this>}
更新密码
Parameters:
Name | Type | Description |
---|---|---|
options |
BaaS.UpdatePasswordParams |
- Source:
Returns:
UserRecord 实例
- Type
- Promise.<this>
verifyMobilePhone(code) → {Promise.<this>}
验证手机号
Parameters:
Name | Type | Description |
---|---|---|
code |
string | 短信验证码 |
- Source:
Returns:
UserRecord 实例
- Type
- Promise.<this>
set(key, value) → {this}
给字段赋值
Parameters:
Name | Type | Description |
---|---|---|
key |
string | 字段名称 |
value |
string | 值 |
- Overrides:
- Source:
Returns:
- Type
- this