Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
})
}
// 回复
_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)
export function requestSmsCode(payload) {
const { phone } = payload
return AV.Cloud.requestSmsCode(phone).then(function(result) {
return result.toJSON()
})
}
export function requestSmsCode(payload) {
const { phone } = payload
return AV.Cloud.requestSmsCode(phone).then(function(result) {
return result.toJSON()
})
}