Vue navigation guard and axios interceptor

I found that beforeEach, the vue navigation guard, can verify login permissions, so is there no need for axios interceptors? I hope the bosses will tell us what you think.
or rather, the axios interceptor is sufficient, and there is no need for vue navigation guards. Bosses, please answer


The interceptor of

axios is used to unify the processing parameters (add token), and process the returned data
beforeEach hook to determine whether to jump the route based on the returned permission data.

< hr >

do you want to.
do you want to determine permissions in the created hook of each component?
add common parameters such as token every time you send a request?

Menu