How to use the leancloud-storage.Cloud function in leancloud-storage

To help you get started, we’ve selected a few leancloud-storage examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github liangtongzhuo / vscodechina / src / js / component / message / index.js View on Github external
this._snackBarOpen('哎~,你忘记登陆了耶')
      return
    }

    const messages = this.state.messages
    const bool = messages[index].likeBool
    const like = messages[index].get('like')
    messages[index].likeBool = !bool
    if (bool) {
      messages[index].set('like', like - 1);
    } else {
      messages[index].set('like', like + 1);
    }
    this.setState({ messages })
    const id = this.state.messages[index].id
    AV.Cloud.run('messageLike', { id }).then(result => {
    }).catch(err => {
      this._snackBarOpen('讨厌,网络错误了')
      console.log(err)
    })
  }
  // 回复
github liangtongzhuo / vscodechina / src / js / oauth / index.js View on Github external
_oauth() {
    const { code, state } = this.state
      if (!code) return window.location.href='/'      
    // 传送 code,换取登陆信息。
    AV.Cloud.run('gitHubOauth', {
      code,
      state
    }).then(result => {
      // 登陆
      return AV.User.signUpOrlogInWithAuthData({
        'uid': result.uid + '',
        'access_token': result.access_token,
      }, 'github')
    }).then(_ => {
      this.setState({ progressShow: false })        
      window.location.href='/'      
  
    }).catch(err => {
      this.setState({ progressShow: false, error: true })
      this._snackBarOpen('好奇怪耶~,获取不到你的 GitHub 交友信息~', 5000)
      console.log(err)
github zxj963577494 / OverWatchTeams / src / services / leanclound / common.js View on Github external
export function requestSmsCode(payload) {
  const { phone } = payload
  return AV.Cloud.requestSmsCode(phone).then(function(result) {
    return result.toJSON()
  })
}
github zxj963577494 / OverWatchTeams-React-Native-Expo / src / services / leanclound / common.js View on Github external
export function requestSmsCode(payload) {
  const { phone } = payload
  return AV.Cloud.requestSmsCode(phone).then(function(result) {
    return result.toJSON()
  })
}