ccjgmwz 4 tahun lalu
induk
melakukan
50672e8fe0
3 mengubah file dengan 7 tambahan dan 11 penghapusan
  1. 2 2
      unimall-app/App.vue
  2. 2 3
      unimall-app/pages/public/login.vue
  3. 3 6
      unimall-app/store/index.js

+ 2 - 2
unimall-app/App.vue

@@ -23,9 +23,9 @@
 				});
 			}
 			// #ifdef APP-PLUS
+			var that = this
 			plus.push.getClientInfoAsync((info) => {
-				uni.setStorageSync('clientId', info.clientid)
-				console.log("info.clientid",info.clientid)
+				that.$store.commit('clientId', info.clientid)
 			   }, err => {
 			});
 			// #endif

+ 2 - 3
unimall-app/pages/public/login.vue

@@ -172,12 +172,11 @@
 				uni.showLoading({
 					title: '登录中'
 				})
-				var clientid = uni.getStorage("clientId")
-				console.log("clientid",clientid)
+				console.log("clientid",clientId)
 				this.$api.request('user', 'login',{
 					password:that.password,
 					phone:that.phone,
-					cid:clientid
+					cid:clientId
 				}, failres => {
 			           that.$api.msg(failres.errmsg)
 			           uni.hideLoading()

+ 3 - 6
unimall-app/store/index.js

@@ -11,7 +11,7 @@ try {
 }
 
 // 需要永久存储,且下次APP启动需要取出的,在state中的变量名
-let saveStateKeys = ['firendItem','userData','pushRes','myTip','taskTip','contractTip','liangxinTip','packet','linkItem','memberItem','memberItemIndex','chatItem'];
+let saveStateKeys = ['firendItem','userData','pushRes','myTip','taskTip','contractTip','liangxinTip','packet','linkItem','memberItem','memberItemIndex','chatItem','clientId'];
 
 // 保存变量到本地存储中
 const saveLifeData = function(key, value) {
@@ -86,11 +86,8 @@ const store = new Vuex.Store({
 		circleData: [],
 		//内置朋友圈相册banner图
 		circleBgList:[
-			// { src:require('@/static/image/circleBanner/1.jpg'), isCheck:false },
-			// { src:require('@/static/image/circleBanner/2.jpg'), isCheck:false },
-			// { src:require('@/static/image/circleBanner/3.jpg'), isCheck:false },
-			// { src:require('@/static/image/circleBanner/4.jpg'), isCheck:false },
-		]
+		],
+		clientId:""
 	},
 	mutations: {
 		$uStore(state, payload) {