feat: 获取购物车商品前端判断是否登录

merge-requests/44/head
xiaoguang 3 years ago
parent 465f2508f9
commit 279b82b8fc

@ -101,7 +101,7 @@ export default {
}; };
}, },
computed: { computed: {
...mapState(["cartProducts"]), ...mapState(["cartProducts", "token"]),
}, },
watch: { watch: {
cartProducts: { cartProducts: {
@ -126,7 +126,9 @@ export default {
}, },
}, },
created() { created() {
this.$store.dispatch("getCartProducts"); if (this.token) {
this.$store.dispatch("getCartProducts");
}
}, },
methods: { methods: {
onJumpCart() { onJumpCart() {

Loading…
Cancel
Save