Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Vue from 'vue'
- import Vuex from 'vuex'
- import axios from 'axios'
- Vue.use(Vuex)
- const store = () => new Vuex.Store({
- state: {
- results: []
- },
- actions: {
- data ({ state, dispatch, commit }, username, password) {
- axios.post(
- 'http://127.0.0.1/token',
- {
- username: username,
- password: password
- }
- )
- .then(
- (res) => {
- const results= res.data.token
- }
- )
- }
- }
- })
- export default store
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement