Edit number 2

This commit is contained in:
saeid_01
2019-04-17 10:01:49 +04:30
parent ee6c36ade3
commit a20768868d
8 changed files with 164 additions and 72 deletions
+4 -4
View File
@@ -1,13 +1,13 @@
import { UserService, AuthenticationError } from '@/services/auth/user.service'
import router from '@/router'
import axios from 'axios'
export default {
async login({ commit }, {cell_number, password}) {
commit('loginRequest');
try {
const token = await UserService.login(cell_number, password);
commit('loginSuccess', token)
commit('loginSuccess', token);
// Redirect the user to the page he first tried to visit or to the home view
router.push(router.history.current.query.redirect || '/');
@@ -32,8 +32,8 @@ export default {
// TODO: Open Modal For Get Section
},
logout({ commit }) {
UserService.logout()
async logout({ commit }) {
const result = await UserService.logout();
commit('logoutSuccess')
router.push('/login')
},