Browse Source

auto commit

gcz 3 years ago
parent
commit
bd322ff8d9
2 changed files with 9 additions and 2 deletions
  1. 7 0
      src/main.js
  2. 2 2
      src/views/Home.vue

+ 7 - 0
src/main.js

@@ -26,6 +26,13 @@ Vue.prototype.$mc = $mc
 let vuexStore = require('@/store/$mc.mixin.js')
 Vue.mixin(vuexStore.mcStore)
 
+//从登录页过来刷新一次
+router.afterEach((to, from) => {
+  if (from.name == 'Login') {
+    router.go(0)
+  }
+})
+
 new Vue({
   router,
   store: vuexStore.store,

+ 2 - 2
src/views/Home.vue

@@ -235,7 +235,7 @@ export default {
   },
   created() {
     // console.log("localStorage.getItem", localStorage.getItem("lifeData"));
-    console.log("this.$router", this.$router);
+    // console.log("this.$router", this.$router);
     this.getinfo();
     this.handelGetTrade();
     this.handelGetScope();
@@ -250,7 +250,7 @@ export default {
     }
   },
   beforeRouteEnter(to, from, next) {
-    console.log(from, "beforeRouteEnter");
+    // console.log(from, "beforeRouteEnter");
     next((vm) => {
       // vm相当于上面的this
       vm.fromPage = from.path;