Vue login function
问题 I'm trying to hook up my backend with JWT authentication to a login component in Vue. This is my Vuex action: userLogin({commit}, payload) { axios.post('/users/token/obtain/', { email: payload.email, password: payload.password, }) .then(response => { localStorage.setItem('access', response.data.access) localStorage.setItem('refresh', response.data.refresh) let body = JSON.parse(atob(response.data.access.split('.')[1])) commit('userLogin', { userToken: response.data.access, userEmail: body