File tree Expand file tree Collapse file tree 3 files changed +3
-80
lines changed
Expand file tree Collapse file tree 3 files changed +3
-80
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import Vue from 'vue'
22import Router from 'vue-router'
33import Home from './views/Home.vue'
44import Dashboard from './views/Dashboard.vue'
5- import RegisterUser from './views/RegisterUser.vue'
65
76Vue . use ( Router )
87
@@ -19,11 +18,6 @@ const router = new Router({
1918 path : '/dashboard' ,
2019 name : 'dashboard' ,
2120 component : Dashboard
22- } ,
23- {
24- path : '/register' ,
25- name : 'register' ,
26- component : RegisterUser
2721 }
2822 ]
2923} )
Original file line number Diff line number Diff line change 11import Vue from 'vue'
22import Vuex from 'vuex'
3- import axios from 'axios'
43
54Vue . use ( Vuex )
65
76export default new Vuex . Store ( {
8- state : {
9- user : null
10- } ,
11- mutations : {
12- SET_USER_DATA ( state , userData ) {
13- state . user = userData
14- localStorage . setItem ( 'user' , JSON . stringify ( userData ) )
15- axios . defaults . headers . common [ 'Authorization' ] = `Bearer ${
16- userData . token
17- } `
18- }
19- } ,
20- actions : {
21- register ( { commit } , credentials ) {
22- return axios
23- . post ( '//localhost:3000/register' , credentials )
24- . then ( ( { data } ) => {
25- commit ( 'SET_USER_DATA' , data )
26- } )
27- }
28- }
7+ state : { } ,
8+ mutations : { } ,
9+ actions : { }
2910} )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments