lxf пре 1 недеља
родитељ
комит
1b7c1589b1

+ 1 - 3
src/mixins/tradeAssets.js

@@ -70,9 +70,7 @@ export default {
             message: data.action === "logoutUser" ? this.$t('ajax.l4') : this.$t('ajax.l2'),
             type: 'danger'
           });
-          this.$store.commit('SET_LOGIN', false)
-          this.$store.commit('setAccountList', [])
-          this.$store.commit('setCashInfo', {})
+          this.$store.dispatch('logout')
           bus.$emit('socketInit')
           this.$router.push('/login')
         }

+ 1 - 1
src/router/index.js

@@ -144,7 +144,7 @@ export const constantRoutes = [
             path: 'follow/:market?',
             component: () => import(/* webpackChunkName: "follow" */ '@/view/copyTrade/marketview'),
             name: 'follow',
-            meta: { keepAlive: true, socket: true },
+            meta: { keepAlive: false, socket: true },
           }
         ]
       },

+ 8 - 0
src/store/modules/user.js

@@ -92,6 +92,14 @@ const user = {
         }
       })
     },
+    logout({commit}) {
+      commit('SET_LOGIN', false)
+      commit('setAccountList', [])
+      commit('setCashInfo', {})
+      commit('setFollowAccount', {})
+      commit('setExpertInfo', {})
+      commit('setFollowList', [])
+    }
   }
 }
 

+ 5 - 1
src/view/copyTrade/marketview/index.vue

@@ -16,7 +16,7 @@
         {{ $t('market.l10') }}
         <div class="line"></div>
       </div>
-      <div class="href flex" @click="$router.push('/my-copy')">
+      <div class="href flex" v-if="expertInfo.status == 1" @click="$router.push('/my-copy')">
         <div>
           <!-- 专家主页 -->
           {{ $t('follow.l166') }}
@@ -30,6 +30,7 @@
   </div>
 </template>
 <script>
+import { mapGetters } from "vuex";
 import findView from "./find";
 import tradingExperts from "./tradingExperts";
 export default {
@@ -42,6 +43,9 @@ export default {
       market: '1',
     }
   },
+  computed: {
+    ...mapGetters(['expertInfo']),
+  },
   watch: {
     '$route'() {
       if (this.$route.name == 'follow') {

+ 1 - 1
src/view/copyTrade/register/index.vue

@@ -229,7 +229,7 @@ export default {
       if (this.selectType == 1) {
         this.form.country = val.code
       } else {
-        this.area = val.area
+        this.area = val.area_code
       }
     },
     getList(list) {

+ 1 - 3
src/view/fit/index.vue

@@ -82,9 +82,7 @@ export default {
         type: 'success'
       });
       this.logOutPop = false
-      this.$store.commit('SET_LOGIN', false)
-      this.$store.commit('setAccountList', [])
-      this.$store.commit('setCashInfo', {})
+      this.$store.dispatch('logout')
       this.$store.dispatch('getProductUserList')
       bus.$emit('socketInit')
     }

+ 1 - 3
src/view/home/router/nav.vue

@@ -220,9 +220,7 @@ export default {
         type: 'success'
       });
       this.logOutPop = false
-      this.$store.commit('SET_LOGIN', false)
-      this.$store.commit('setAccountList', [])
-      this.$store.commit('setCashInfo', {})
+      this.$store.dispatch('logout')
       this.$store.dispatch('getProductUserList')
       bus.$emit('socketInit')
     }

+ 1 - 1
src/view/market/index.vue

@@ -9,7 +9,7 @@
         <searchIcon width="20px"></searchIcon>
       </div>
     </div>
-    <router-view></router-view>
+    <router-view :key="$route.fullPath"></router-view>
   </div>
 </template>
 <script>

+ 1 - 3
src/view/register/index.vue

@@ -231,9 +231,7 @@ export default {
   },
   mounted() {
     if (this.isLogin) {
-      this.$store.commit('SET_LOGIN', false)
-      this.$store.commit('setAccountList', [])
-      this.$store.commit('setCashInfo', {})
+      this.$store.dispatch('logout')
       bus.$emit('socketInit')
     }
     setTimeout(() => {

+ 1 - 3
src/view/setting/index.vue

@@ -190,9 +190,7 @@ export default {
           message: this.$t('common.l52'),
           type: 'success'
         });
-        this.$store.commit('SET_LOGIN', false)
-        this.$store.commit('setAccountList', [])
-        this.$store.commit('setCashInfo', {})
+        this.$store.dispatch('logout')
         this.$router.replace('/')
       }).finally(() => {
         this.fullscreenLoading = false;

+ 1 - 3
src/view/thaw/index.vue

@@ -206,9 +206,7 @@ export default {
     },
     logout() {
       logOut().then((res) => {
-        this.$store.commit('SET_LOGIN', false)
-        this.$store.commit('setAccountList', [])
-        this.$store.commit('setCashInfo', {})
+        this.$store.dispatch('logout')
         this.$notify({
           // message: '退出成功',
           message: this.$t('home.l29'),

+ 1 - 3
src/view/updateEmail/index.vue

@@ -230,9 +230,7 @@ export default {
             message: this.$t('setting.alter2'),
             type: 'success'
           });
-          this.$store.commit('SET_LOGIN', false)
-          this.$store.commit('setAccountList', [])
-          this.$store.commit('setCashInfo', {})
+          this.$store.dispatch('logout')
           this.$router.replace('/login')
         }).catch(() => {
         }).finally(() => {

+ 1 - 3
src/view/updatePassword/index.vue

@@ -118,9 +118,7 @@ export default {
           message: this.$t('setting.alter-p'),
           type: 'success'
         });
-        this.$store.commit('SET_LOGIN', false)
-        this.$store.commit('setAccountList', [])
-        this.$store.commit('setCashInfo', {})
+        this.$store.dispatch('logout')
         this.$router.replace('/login')
       }).catch(() => {
       }).finally(() => {

+ 1 - 3
src/view/updatePhone/index.vue

@@ -236,9 +236,7 @@ export default {
             message: this.$t('setting.alter1'),
             type: 'success'
           });
-          this.$store.commit('SET_LOGIN', false)
-          this.$store.commit('setAccountList', [])
-          this.$store.commit('setCashInfo', {})
+          this.$store.dispatch('logout')
           this.$router.replace('/login')
         }).catch(() => {
         }).finally(() => {