Skip to content

Instantly share code, notes, and snippets.

@PadreSVK

PadreSVK/aaa.js

Created Apr 22, 2020
Embed
What would you like to do?
async update({ commit }, { token, password })
{
const result = await axios.put(
passwordChangeUrl,
{ token, password },
{ validateStatus: status => status === 404 || status === 400 }
)
switch (result.status) {
case 404:
commit("login is expired")
break
case 400:
commit("validation failed")
break
default:
this.$auth.setUserToken(result.data)
this.$router.push({name:index})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.