How can axios be used in Vue server rendering to prevent contamination?

my backend uses the JWT, front-end vue ssr to set up the axios interceptor, but it is not easy to write, and there will be global token contamination of axios.
my token is currently stored in vuex.
excuse me, is there any way to simply encapsulate axios and prevent contamination?

Apr.20,2021

it can be understood that your interface request requires token,. If you want to tune the required interface, clean up the token

.

if this is the case, there is no need to put token in the vuex. When ssr, put token into session or requerst context, and when you request an interface, you can simply fetch it

.
Menu