Can the actions method in vuex dispatch another method after the dispatch is called?

clipboard.png

clipboard.png

the requirement is that when I click the login button, I need to request an interface to determine whether the user has successfully logged in, change the status in store if successful, and then jump to the page according to the status. The interface that determines whether the user is logged in or not needs to be fetched before each interface request. Ask the great god for an answer. How can we do that?

Mar.21,2021

of course write like this and you'll see


there's nothing wrong with it. It can be replaced with async/await. It's more readable. It's more readable.


it's possible, complete ok

.
Menu