orderiom-api-package 0.4.104 → 0.4.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/modules/auth.js +1 -1
- package/src/modules/order.js +13 -5
package/package.json
CHANGED
package/src/modules/auth.js
CHANGED
|
@@ -126,7 +126,7 @@ const actions = {
|
|
|
126
126
|
tryAutoLogin({commit, dispatch}) {
|
|
127
127
|
const pt = window.localStorage.getItem("privateToken") || null
|
|
128
128
|
if (!pt || isTokenExpired(pt)) return;
|
|
129
|
-
dispatch('fetchUser')
|
|
129
|
+
return dispatch('fetchUser')
|
|
130
130
|
},
|
|
131
131
|
logout({commit, state, dispatch}, restaurantId) {
|
|
132
132
|
if (!window.localStorage.getItem("privateToken") && !state.user.id) return;
|
package/src/modules/order.js
CHANGED
|
@@ -558,10 +558,6 @@ const actions = {
|
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
|
|
561
|
-
commit("product/SetShoppingCart", [], {root: true});
|
|
562
|
-
commit("product/setBasketInfo", {}, {root: true});
|
|
563
|
-
commit("product/setDeliveryTime", "", {root: true});
|
|
564
|
-
|
|
565
561
|
const classicRedirect = (res) => {
|
|
566
562
|
window.location = res.data.data.paymentLink;
|
|
567
563
|
return res;
|
|
@@ -585,7 +581,15 @@ const actions = {
|
|
|
585
581
|
name = typeof data.routeName === 'string' ? null : data.routeName['payment']
|
|
586
582
|
}
|
|
587
583
|
|
|
588
|
-
if(!name)
|
|
584
|
+
if(!name) {
|
|
585
|
+
classicRedirect(res);
|
|
586
|
+
|
|
587
|
+
commit("product/SetShoppingCart", [], {root: true});
|
|
588
|
+
commit("product/setBasketInfo", {}, {root: true});
|
|
589
|
+
commit("product/setDeliveryTime", "", {root: true});
|
|
590
|
+
|
|
591
|
+
return
|
|
592
|
+
}
|
|
589
593
|
|
|
590
594
|
data.$router.push({
|
|
591
595
|
name,
|
|
@@ -599,6 +603,10 @@ const actions = {
|
|
|
599
603
|
return result;
|
|
600
604
|
}, {}),
|
|
601
605
|
});
|
|
606
|
+
|
|
607
|
+
commit("product/SetShoppingCart", [], {root: true});
|
|
608
|
+
commit("product/setBasketInfo", {}, {root: true});
|
|
609
|
+
commit("product/setDeliveryTime", "", {root: true});
|
|
602
610
|
}).catch(error => {
|
|
603
611
|
const status = error.response ? error.response.status : null;
|
|
604
612
|
if (status === 422) {
|