Guest User

Untitled

a guest
Jun 19th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. login=()=>{
  2. fetch('http://192.168.0.101:9090/Shakehands',{
  3. method:'post',
  4. headers:{
  5. 'Accept':'application/json',
  6. 'Content-type':'application/json',
  7. },
  8. body:JSON.stringify({
  9. email:this.email,
  10. password:this.password,
  11. text:"Login"
  12. })
  13. })
  14. .then((responseData)=>{
  15. return responseData.json();
  16. })
  17. .then((responseData)=>{
  18. //console.log(responseData);
  19. //alert(this.state.insdata)
  20. if(responseData.success=true){
  21. this.props.navigation.navigate('Home');
  22. }
  23. else{
  24. alert(responseData.message);
  25. }
  26. }).done();
  27. }
  28.  
  29. if(rows.length>0){
  30. res.send({'success':true,'message':'Welcome'})
  31. }
  32.  
  33. else{
  34. res.send(JSON.stringify({'success':false,'message':'User not found'}))
  35. }
  36. })
Add Comment
Please, Sign In to add comment