Browse Source

Merge remote-tracking branch 'origin/release-201818' into release-201818

shenjj 7 years ago
parent
commit
cd3b8311ce
2 changed files with 11 additions and 13 deletions
  1. 2 2
      pages/mobile/center/user/cart.vue
  2. 9 11
      store/index.js

+ 2 - 2
pages/mobile/center/user/cart.vue

@@ -328,12 +328,12 @@
       },
       removeInvalidGoods () {
         let arr = []
-        this.allActiveObj.forEach(item => {
+        this.cartData.content.forEach(item => {
           if (item.status === 1) {
             arr.push(item.id)
           }
         })
-        if (!arr.length) {
+        if (arr.length === 0) {
           this.setRemindText('购物车内目前没有失效的产品')
         } else {
           this.doDelete(arr, '成功清除购物车内的无效产品')

+ 9 - 11
store/index.js

@@ -38,17 +38,15 @@ export const actions = {
       let messageType = route.query.messageType || ''
       store.commit('option/GET_MESSAGETYPE', messageType)
     }
-    if (cookie) {
-      if (cookie && cookie.length) {
-        for (let i = 0; i < cookie.length; i++) {
-          if (cookie[i].indexOf('JSESSIONID') > -1) {
-            const sessionId = cookie[i]
-            const first = sessionId.indexOf(';')
-            const second = sessionId.lastIndexOf(';')
-            const newSessionId = sessionId.replace(sessionId.substring(first, second), '')
-            store.commit('option/SET_SESSION_ID', newSessionId)
-            break
-          }
+    if (cookie && cookie.length) {
+      for (let i = 0; i < cookie.length; i++) {
+        if (cookie[i].indexOf('JSESSIONID') > -1) {
+          const sessionId = cookie[i]
+          const first = sessionId.indexOf(';')
+          const second = sessionId.lastIndexOf(';')
+          const newSessionId = sessionId.replace(sessionId.substring(first, second), '')
+          store.commit('option/SET_SESSION_ID', newSessionId)
+          break
         }
       }
       axios.defaults.headers['cookie'] = store.state.option.cookies + '; ' + store.state.option.sessionId