forked from verdnatura/salix-front
Compare commits
14 Commits
dev
...
6172_trans
Author | SHA1 | Date |
---|---|---|
Javi Gallego | 02272143d3 | |
Javier Segarra | 387d7a33e6 | |
Javier Segarra | da00a3f05f | |
Javier Segarra | 44e9c5f3d9 | |
Javier Segarra | 8631b642eb | |
Javier Segarra | 31d000b65f | |
Javier Segarra | 1b0cfa0d86 | |
Javier Segarra | 1c9493839d | |
Javier Segarra | 897d410ee6 | |
Javier Segarra | ca314c65d8 | |
Javier Segarra | 134cf011e3 | |
Javier Segarra | c4416545f8 | |
Javier Segarra | 8cfd775d58 | |
Javier Segarra | e525f87ccd |
|
@ -37,14 +37,11 @@ const onResponse = (response) => {
|
|||
};
|
||||
|
||||
const onResponseError = (error) => {
|
||||
let message = '';
|
||||
|
||||
const response = error.response;
|
||||
const responseData = response && response.data;
|
||||
const responseError = responseData && response.data.error;
|
||||
if (responseError) {
|
||||
message = responseError.message;
|
||||
if (!session.isLoggedIn()) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
const { response } = error;
|
||||
let message = response?.data?.error?.message;
|
||||
|
||||
switch (response?.status) {
|
||||
case 500:
|
||||
|
@ -56,15 +53,14 @@ const onResponseError = (error) => {
|
|||
case 504:
|
||||
message = 'errors.statusGatewayTimeout';
|
||||
break;
|
||||
}
|
||||
|
||||
if (session.isLoggedIn() && response?.status === 401) {
|
||||
session.destroy();
|
||||
const hash = window.location.hash;
|
||||
const url = hash.slice(1);
|
||||
Router.push({ path: url });
|
||||
} else if (!session.isLoggedIn()) {
|
||||
return Promise.reject(error);
|
||||
case 401:
|
||||
if (session.isLoggedIn()) {
|
||||
session.destroy();
|
||||
const hash = window.location.hash;
|
||||
const url = hash.slice(1);
|
||||
Router.push({ path: url });
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Notify.create({
|
||||
|
|
|
@ -233,7 +233,7 @@ export default {
|
|||
agency: 'Agency',
|
||||
shipped: 'Shipped',
|
||||
warehouse: 'Warehouse',
|
||||
customerCard: 'Customer card',
|
||||
customerCard: 'Customer card'
|
||||
},
|
||||
boxing: {
|
||||
expedition: 'Expedition',
|
||||
|
|
Loading…
Reference in New Issue