Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
nickName,
profileImg
}
userStorage.setData(_user)
this.props.userLogin(_user)
let _timer = setTimeout(() => {
let { toPage } = this.props
if (toPage.routeName && toPage.routeName == 'UserInfo') {
NavigationService.navigate('DrawerClose')
} else {
NavigationService.navigateWithWholeRouteParmas(toPage)
}
// console.log(1111111111111,this.props.toPage);
clearTimeout(_timer)
}, 300)
JPushModule.getRegistrationID(
registrationId => {
saveDevices(registrationId, data.sid)
.then(sdata => {
this.props.toggleLogin(false)
})
.catch(err => {
this.props.toggleLogin(false)
})
},
() => {
ToastUtil.showWithMessage(i18n.login_tips.fail.login)
}
)
this.setState({ loading: false })
})
.catch(err => {
onInitPress() {
console.log('on click init push ');
// PushHelper.setupPush('dssdf');
JPushModule.getRegistrationID((registrationid) => {
console.log(registrationid);
this.setState({regid: registrationid});
});
},
onSetuplocalNotificationPress() {
onInitPress() {
console.log('on click init push ');
JPushModule.getRegistrationID((registrationid) => {
console.log(registrationid);
this.setState({regid: registrationid});
});
}
onSetuplocalNotificationPress() {
onPress={() => JPush.getRegistrationID(result =>
console.log("registerID:" + JSON.stringify(result))
)}/>
onGetRegistrationIdPress() {
JPushModule.getRegistrationID((registrationId) => {
this.setState({
registrationId: registrationId
});
});
}
this.props.navigation.goBack()
}else {
if(params.page == 'Order') {
this.props.navigation.navigate('Order',
{
replaceRoute: true,
foodId: params.foodId,
placeId: params.placeId,
amount: params.amount,
total: params.total
})
}else {
this.props.navigation.navigate(params.page,{replaceRoute: true,});
}
}
JPushModule.getRegistrationID(registrationId => {
api.saveDevices(registrationId,this.token);
},() => {
ToastUtil.showWithMessage("登錄失敗")
})
}
else{
ToastUtil.showWithMessage(data.data.ro.respMsg);
}
},() => {
ToastUtil.showWithMessage("登錄失敗")
onGetRegistrationIdPress() {
JPushModule.getRegistrationID((registrationId) => {
this.setState({registrationId: registrationId});
});
}