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
+2 -2
View File
@@ -62,14 +62,14 @@ const ApiService = {
},
async (error) => {
if (error.request.status == 401) {
if (error.config.url.includes('auth/login')) {
if (error.config.url.includes('login')) {
// Refresh token has failed. Logout the user
store.dispatch('auth/logout');
throw error;
} else {
// Refresh the access token
try{
await store.dispatch('auth/refreshToken')
await store.dispatch('refreshToken')
// Retry the original request
return this.customRequest({
method: error.config.method,