Advertisement
Guest User

Untitled

a guest
Apr 11th, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. function loginAlfresco(user, pass)
  2. {
  3. return fetch(alfrescoLocal + "api/login",
  4. {
  5. method: 'post',
  6. dataType: 'json',
  7. body: JSON.stringify(
  8. {
  9. username: user,
  10. password: pass
  11. })
  12. })
  13. .then((res) => res.json())
  14. .then(data => alert(data))
  15. .catch(error => alert("Error" + error))
  16. };
  17.  
  18. loginAlfresco() {
  19. loginAlfresco(this.state.username, this.state.password)
  20. .then((data) =>
  21. this.setState({ticket: data})
  22. ).catch((error) =>
  23. alert(error)
  24. )
  25. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement