lilei 3 lat temu
rodzic
commit
058baca8b5
3 zmienionych plików z 9 dodań i 15 usunięć
  1. 8 8
      pages/index/index.vue
  2. 0 6
      pages/personData/personData.vue
  3. 1 1
      store/index.js

+ 8 - 8
pages/index/index.vue

@@ -65,7 +65,7 @@
 <script>
 <script>
 	import {
 	import {
 	    mapState,
 	    mapState,
-	    mapMutations
+	    mapMutations,
 	} from 'vuex'
 	} from 'vuex'
 	import scrollBox from '@/components/scrollBox.vue'
 	import scrollBox from '@/components/scrollBox.vue'
 	import { shelfBondRecordWaitPayRecord, findStoreShelf } from '@/api/shelf.js'
 	import { shelfBondRecordWaitPayRecord, findStoreShelf } from '@/api/shelf.js'
@@ -94,17 +94,17 @@
 			}
 			}
 		},
 		},
 		onLoad() {
 		onLoad() {
-			if(this.hasLogin){
-				this.getStoreShelf()
-				// 获取数据字典
-				this.getListLookUp();
-				// 获取支付,收款方式
-				this.getLookUpList('PAY_PROCUCT_TYPE', 'vuex_paymentTypeList');
-			}
+			// 检测是否登录
+			this.$store.dispatch('checkLogin')
+			// 获取数据字典
+			this.getListLookUp();
+			// 获取支付,收款方式
+			this.getLookUpList('PAY_PROCUCT_TYPE', 'vuex_paymentTypeList');
 		},
 		},
 		onShow() {
 		onShow() {
 			if(this.hasLogin){
 			if(this.hasLogin){
 				this.$store.state.vuex_userInfo = uni.getStorageSync('userInfo')
 				this.$store.state.vuex_userInfo = uni.getStorageSync('userInfo')
+				this.getStoreShelf()
 				// 获取扫描记录
 				// 获取扫描记录
 				this.getScrollLog()
 				this.getScrollLog()
 				this.getVinLog()
 				this.getVinLog()

+ 0 - 6
pages/personData/personData.vue

@@ -81,12 +81,6 @@
         methods: {
         methods: {
           loginOut(){
           loginOut(){
 			  this.$refs.openModal.open()
 			  this.$refs.openModal.open()
-			  // this.$store.dispatch('userLogout');
-			  // setTimeout(function(){
-				 //  uni.redirectTo({
-				 //      url: '/pages/login/login'
-				 //  });
-			  // },300)
 		  },
 		  },
 		  onOk(){
 		  onOk(){
 			this.$refs.openModal.close()
 			this.$refs.openModal.close()

+ 1 - 1
store/index.js

@@ -130,7 +130,7 @@ const store = new Vuex.Store({
 		checkLogin(context,data){
 		checkLogin(context,data){
 			checkLogin().then(res => {
 			checkLogin().then(res => {
 				if(res.status == '200'){
 				if(res.status == '200'){
-					context.commit('login',res.data)
+					// context.commit('login',res.data)
 				}else{
 				}else{
 					context.commit('logout')
 					context.commit('logout')
 				}
 				}