sunchengjie 9 månader sedan
förälder
incheckning
4e9291e815
1 ändrade filer med 12 tillägg och 4 borttagningar
  1. 12 4
      src/main.js

+ 12 - 4
src/main.js

@@ -56,11 +56,13 @@ router.beforeEach((to, from, next) => {
 				
 				if(to.path == '/') {
 					if(sessionstorage.getItem("isReload") === 'isReloadVlaue'){
-						window.location.reload()
 						next()
+						window.location.reload()
+						console.log('有isReloadVlaue')
 					}else{
 						sessionStorage.setItem("isReload",'isReloadVlaue')
 						next()
+						console.log('无isReloadVlaue')
 					}
 				}else {
 					next()
@@ -70,9 +72,15 @@ router.beforeEach((to, from, next) => {
 		} else {
 			console.log('什么都有')
 			if(to.path == '/') {
-				console.log('window.location.reload()')
-				// window.location.reload()
-				next()
+				if(sessionstorage.getItem("isReload") === 'isReloadVlaue'){
+					next()
+					window.location.reload()
+					console.log('有isReloadVlaue')
+				}else{
+					sessionStorage.setItem("isReload",'isReloadVlaue')
+					next()
+					console.log('无isReloadVlaue')
+				}
 			}else {
 				next()
 			}