Last active
July 13, 2019 17:58
-
-
Save lesovsky/a517b71aee36296183c87fdb411107e5 to your computer and use it in GitHub Desktop.
auth-guard.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios' | |
export default { | |
doAction (to, from, next) { | |
axios.post('http://127.0.0.1:1080/api/v2/action', {"data":"..."}) | |
.then(request => this.actionSuccessful(request)) | |
.catch(() => this.actionFailed()) | |
}, | |
actionSuccessful (req) { | |
... | |
}, | |
actionFailed () { | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment