user

用户模块

Methods

(static) login(option) → {Promise.<ResponseModel.<LoginModal>>}

登录
Example
zghl.getUserManager().login({
     phone: '13800138000'
 }).then(function(response){
     console.log(response)
 })
Parameters:
Name Type Description
option Object
Properties
Name Type Description
phone Number | String 手机号码
Returns:
Type
Promise.<ResponseModel.<LoginModal>>

(static) logout() → {Promise.<ResponseModel>}

退出登录状态
Example
zghl.getUserManager().logout().then(function(response){
     console.log(response)
 })
Returns:
Type
Promise.<ResponseModel>

(static) getUserData() → {Promise.<ResponseModel.<UserDataModel>>}

获取用户基础信息
Example
zghl.getUserManager().getUserData().then(function(response){
     console.log(response)
 })
Returns:
Type
Promise.<ResponseModel.<UserDataModel>>

(static) getUserFace() → {Promise}

获取用户人脸信息
Example
zghl.getUserManager().getUserFace().then(function(response){
     console.log(response)
 })
Returns:
Type
Promise

(static) uploadUserFace(option) → {Promise}

上传用户人脸图片
Example
zghl.getUserManager().uploadUserFace().then(function(response){
     console.log(response)
 })
Parameters:
Name Type Description
option Object
Properties
Name Type Description
file File 人脸图片
onUploadProgress function 上传进度回调
Returns:
Type
Promise

(static) registerUserFace(option) → {Promise}

注册用户人脸信息
Example
zghl.getUserManager().registerUserFace({
     face_image: 'QINIU_RETURN_KEY'
 }).then(function(response){
     console.log(response)
 })
Parameters:
Name Type Description
option Object
Properties
Name Type Description
face_image String 人脸图片上传后七牛返回的key
Returns:
Type
Promise

(static) deleteUserFace(option) → {Promise}

删除用户人脸信息
Example
zghl.getUserManager().deleteUserFace({
     uid: '0c7fb2c9b75ad399d129bab179b3db77'
 }).then(function(response){
     console.log(response)
 })
Parameters:
Name Type Description
option Object
Properties
Name Type Description
uid String 人脸信息uid
Returns:
Type
Promise