ccj 3 years ago
parent
commit
ba676fe503
4 changed files with 15 additions and 15 deletions
  1. 12 12
      App.vue
  2. 1 1
      pages/erpbusiness/index.vue
  3. 1 1
      pages/user/setUp.vue
  4. 1 1
      webim.js

+ 12 - 12
App.vue

@@ -169,22 +169,22 @@
 		},
 		onLaunch: function() {
 			// #ifdef APP-PLUS
-			
+			let type = uni.getSystemInfoSync().platform
+			console.log(type)
+			if (type == "android") {
+				//注意:开启服务之后,配置后台运行,白名单,自启动,即可实现长时间保活,黑屏传数据
+				this.goStartService();
+				// !!!如果在设置后台运行的情况下,黑屏不发送数据,请使用setInterval代替 定时任务回调
+				var globalEvent = uni.requireNativePlugin('globalEvent');
+				globalEvent.addEventListener('doJobEvent', function() {
+					console.log("---------")
+					/* uni.request({}) */
+				});
+			}
 			//获取安卓版本号 
 			pushLive.checkAndroidVersion(function(res) {
 				console.log(res)
 			})
-			//注意:开启服务之后,配置后台运行,白名单,自启动,即可实现长时间保活,黑屏传数据
-			this.goStartService();
-			// !!!如果在设置后台运行的情况下,黑屏不发送数据,请使用setInterval代替 定时任务回调
-			var globalEvent = uni.requireNativePlugin('globalEvent');
-			globalEvent.addEventListener('doJobEvent', function() {
-				console.log("---------")
-				/* uni.request({}) */
-			});
-			
-			
-			
 			var that = this
 			plus.push.getClientInfoAsync((info) => {
 				var name = 'clientId'

+ 1 - 1
pages/erpbusiness/index.vue

@@ -305,7 +305,7 @@
 				uni.hideTabBarRedDot({
 					index: 3
 				})
-				uni.clearStorageSync();
+				// uni.clearStorageSync();
 				this.$store.commit('logout')
 				this.$api.logout()
 				uni.navigateTo({

+ 1 - 1
pages/user/setUp.vue

@@ -242,7 +242,7 @@
 				uni.hideTabBarRedDot({
 					index: 3
 				})
-				uni.clearStorageSync();
+				// uni.clearStorageSync();
 				var that = this
 				this.$api.doRequest('post', '/auth/api/logout').then(res => {
 					if (res.data.data) {

+ 1 - 1
webim.js

@@ -150,7 +150,7 @@ const WEBIM = {
 			 && curPage.$page.fullPath != '/pages/sale/information'
 			 && curPage.$page.fullPath.indexOf('/pages/sale/webview') == -1  )
 			{
-				uni.clearStorageSync();
+				// uni.clearStorageSync();
 				let name = 'hasLogin';
 				let value = false;
 				store.commit('$uStore', {