lilei 2 years ago
parent
commit
987587a6df
3 changed files with 11 additions and 11 deletions
  1. 2 2
      App.vue
  2. 4 2
      pages/index/index.vue
  3. 5 7
      pages/personData/personData.vue

+ 2 - 2
App.vue

@@ -1,8 +1,8 @@
 <script>
 	export default {
 		globalData: {
-			baseUrl: 'http://192.168.0.215:9110/saas/clz/', // 本地
-			// baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
+			// baseUrl: 'http://192.168.0.215:9110/saas/clz/', // 本地
+			baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
 			// baseUrl: 'https://car.zyucgj.com/saas/clz/' // 生产
 		},
 		onLaunch: function() {

+ 4 - 2
pages/index/index.vue

@@ -212,6 +212,8 @@
 				this.pageInit()
 				// 查询红包活动
 				this.getRedPacketRule()
+				// 更新用户信息
+				this.getCurrUserInfo()
 			})
 			// 刷新首页数据
 			uni.$on("refashHome",()=>{
@@ -233,6 +235,8 @@
 			// 用户头像
 			this.avatarUrl = uni.getStorageSync('userPhoto');
 			if(this.hasLogin){
+				// 更新用户信息
+				this.getCurrUserInfo()
 				// 查询门店认证信息
 				if(this.userInfo.sysUserFlag == '0'){
 					this.findLastApply()
@@ -274,8 +278,6 @@
 				if(this.hasLogin){
 					// 获取扫描记录
 					this.getVinLog()
-					// 更新用户信息
-					this.getCurrUserInfo()
 					// 非游客
 					if(this.userInfo.sysUserFlag == '1'){
 						// 查询是否有数字货架

+ 5 - 7
pages/personData/personData.vue

@@ -62,27 +62,25 @@
     } from 'vuex'
     export default {
         components: {
-			uniPopup,uniPopupDialog
+			uniPopup,
+			uniPopupDialog
         },
         data() {
             return {
 				title:'',
-				avatarUrl:""
+				avatarUrl:"",
+				userInfo: null
             }
         },
 		computed: {
 			...mapState(['hasLogin']),
-			userInfo(){
-				return this.$store.state.vuex_userInfo
-			},
 			shelfInfo(){
 				return this.$store.state.vuex_storeShelf
 			},
 		},
 		onShow() {
-			//检测是否登录
-			this.$store.dispatch('checkLogin');
 			this.avatarUrl = this.$store.state.vuex_userPhoto || uni.getStorageSync('userPhoto');
+			this.userInfo = this.$store.state.vuex_userInfo
 		},
         methods: {
 		  onChooseAvatar(e) {