Browse Source

处理商城未登录,首页出现用户信息的异常问题

liusw 7 years ago
parent
commit
d37fe69ac5
1 changed files with 3 additions and 0 deletions
  1. 3 0
      store/index.js

+ 3 - 0
store/index.js

@@ -48,6 +48,9 @@ export const actions = {
       }
       axios.defaults.headers['cookie'] = store.state.option.cookies + '; ' + store.state.option.sessionId
       axios.defaults.headers['User-Agent'] = store.state.option.userAgent
+    } else {
+      axios.defaults.headers['cookie'] = ''
+      axios.defaults.headers['User-Agent'] = ''
     }
     // 设置跳转的URL
     if (!isDev) {