Browse Source

init初始化优化,消息推送bugxiuf,打印去掉

ming 3 years ago
parent
commit
d7d620587c

+ 1 - 1
pages/eleControl/controlReport/controlReportAdd/controlReportAdd.vue

@@ -128,7 +128,7 @@
 			 var _self = this;
 			 
 			 uni.uploadFile({
-			  url: 'https://wx.ewoogi.com/wx/USKYOF/USKYOF.php/Home/MonitoringReporting/setUpload',
+			  url: 'https://wx.ewoogi.com/USKYOF/USKYOF.php/Home/MonitoringReporting/setUpload',
 			 
 			  files: [
 			   {

+ 1 - 1
pages/eleControl/controlReport/controlReportDetail/controlReportDetail.vue

@@ -66,7 +66,7 @@
 			return {
 				siteListData: [],
 				controlReportDetail: {},
-				bathUrl: 'https://wx.ewoogi.com/wx'
+				bathUrl: 'https://wx.ewoogi.com'
 			}
 		},
 		onLoad: function(option) {

+ 10 - 183
pages/index/index.vue

@@ -180,9 +180,6 @@
 
 
 		created: function() {
-			// alert('created')
-
-
 
 		},
 
@@ -191,202 +188,32 @@
 		},
 
 		beforeCreate: function() {
-			let ua = navigator.userAgent.toLowerCase();
-			if (ua.match(/MicroMessenger/i) == "micromessenger") {
-
-				var appId = "wx4eab2e3b5531d58b";
-				var params = {};
-
-				var url = location.search
-				this.winUrl = url
-				var theRequest = new Object()
-				if (url.indexOf("?") != -1) {
-					var str = url.substr(1)
-					var strs = str.split("&")
-					for (var i = 0; i < strs.length; i++) {
-						theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1])
-					}
-				}
-
-
-				var CODE = theRequest;
-				var code = CODE['code'];
-				// alert(code)
-				if (code) {
-
-					params.code = code;
-
-					// alert('code')
-					//使用code请求服务器接口,换取用户用户openID
-
-					uni.request({
-						url: 'https://wx.ewoogi.com/wx/USKYOF/USKYOF.php/Home/Com/getPageAuthorization', //仅为示例,并非真实接口地址。
-						// data: {
-						//     text: 'uni.request'
-						// },
-						method: 'POST',
-						header: {
-							'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
-						},
-						success: (res) => {
-							// alert(res.data.flag)
-							if (res.data.flag == 3000) {
-								// alert("3000授权失败,请重新登录");
-								window.location.href = 'https://wx.ewoogi.com/wx/index.html#/';
-							}
-
-							if (res.data.flag == 3003) {
-								// alert("3003");
-								uni.navigateTo({
-									url: '/pages/authority/authority',
-								});
-							}
-							if (res.data.flag == 3002) {
-								// alert("3002授权失败,请重新登录");
-								uni.switchTab({
-									url: '/pages/index/index'
-								});
-							}
-						}
-					});
-
-				}
-
-				var cs = {};
-				var curl = window.location.href;
-				cs.curl = curl;
-
-				const res1 = this.$myRequest({
-					url: 'Com/getAuthorizationUrl',
-					data: cs
-				})
-
-				var turl = res1.data.turl;
-				window.location.href =
-					'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4eab2e3b5531d58b&redirect_uri=' +
-					turl +
-					'&response_type=code&scope=snsapi_base&state=abc123#wechat_redirect';
-			} else {
-				// alert('不是')
-				//不是
-				// uni.navigateTo({
-				// 	url: '/pages/login/login',
-				// });
-				// setTimeout(function() {
-				// 	uni.navigateTo({
-				// 		url: '/pages/login/login',
-				// 	});
-				// }, 2000);
-			}
-
-
 		},
 
 
 		onLoad: function(option) {
-
-			let ua = navigator.userAgent.toLowerCase();
-			if (ua.match(/MicroMessenger/i) == "micromessenger") {
-
-				var init = this.init();
-				if (init = "3001") {
-					this.getData();
-
-				}
-
-				//是
-
-			} else {
+			
+			if (option.op) {
+				// alert('op')
+				// alert(option.op)
+				// 首页数据渲染
 				this.getData();
-
-
-				//不是
-				// uni.navigateTo({
-				// 	url: '/pages/login/login',
-				// });
-				// setTimeout(function() {
-				// 	uni.navigateTo({
-				// 		url: '/pages/login/login',
-				// 	});
-				// }, 2000);
+			
+			} else {
+				this.init()
 			}
 
 			this.hackReset = false;
 			this.$nextTick(() => {
 				this.hackReset = true;
 			})
-
 		},
 
 		methods: {
 
-			// start
-			getUrlCode() {
-				var url = location.search
-				this.winUrl = url
-				var theRequest = new Object()
-				if (url.indexOf("?") != -1) {
-					var str = url.substr(1)
-					var strs = str.split("&")
-					for (var i = 0; i < strs.length; i++) {
-						theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1])
-					}
-				}
-				return theRequest
-			},
-
+			
 			async init() {
-				var appId = "wx4eab2e3b5531d58b";
-				// var appId = "wx8bba7ec467b61efa"; //ming测试公众号
-
-				var CODE = this.getUrlCode();
-				var code = CODE['code'];
-
-
-				var params = {};
-				if (code) {
-					params.code = code;
-					//使用code请求服务器接口,换取用户用户openID 
-					const res = await this.$myRequest({
-						url: 'Com/getPageAuthorization',
-						data: params
-					})
-
-					if (res.data.flag == 3000) {
-
-						// alert("3000授权失败,");
-						window.location.href = 'https://wx.ewoogi.com/wx/index.html#/';
-					}
-
-					if (res.data.flag == 3003) {
-						// alert("3003授权失败");
-						uni.navigateTo({
-							url: '/pages/authority/authority',
-						});
-					}
-
-					return res.data.flag;
-				}
-
-				var cs = {};
-				var curl = window.location.href;
-				// alert('curl')
-				// alert(curl)
-				cs.curl = curl;
-
-				//
-				const res1 = await this.$myRequest({
-					url: 'Com/getAuthorizationUrl',
-					data: cs
-				})
-
-				var turl = res1.data.turl;
-				// alert('turl')
-				// alert(turl)
-				window.location.href =
-					'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4eab2e3b5531d58b&redirect_uri=' +
-					turl +
-					'&response_type=code&scope=snsapi_base&state=abc123#wechat_redirect';
+				window.location.href =  "https://wx.ewoogi.com/USKYOF/USKYOF.php/Home/Com/getPageAuthorization1"
 			},
 			// end
 

+ 21 - 68
pages/login/login.vue

@@ -36,19 +36,24 @@
 			return {
 				noClick:true,
 				codeTime: 0,
-
-
+				
 				phone: '',
 				verify: '',
 				VerificationCodeOne: ''
 
-
-
 			}
 		},
-		onLoad() {
-
-			this.init()
+		onLoad(option) {
+			// alert(option.flag)
+			
+			if(option.flag){
+				// alert(1)
+				
+			}else{
+				// alert(2)
+				this.init()
+				
+			}
 
 			uni.setNavigationBarColor({
 				frontColor: "#ffffff", //文字颜色
@@ -65,6 +70,13 @@
 
 		},
 		methods: {
+			
+			async init(){
+				window.location.href="https://wx.ewoogi.com/USKYOF/USKYOF.php/Home/Login/getLoginAuthorizes1"
+				
+			},
+			
+			
 			clearPhone(){
 				this.phone=''
 			},
@@ -83,66 +95,7 @@
 				}
 				return theRequest
 			},
-			async init() {
-				let ua = navigator.userAgent.toLowerCase();
-
-				if (ua.match(/MicroMessenger/i) == "micromessenger") {
-
-					var curl2 = window.location.href;
-
-
-					//是
-					var appId = "wx4eab2e3b5531d58b";
-					var params = {};
-					var CODE = this.getUrlCode();
-					var code = CODE['code'];
-					if (code) {
-						params.code = code;
-						const res = await this.$myRequest({
-							url: 'Login/getLoginAuthorize',
-							data: params
-						})
-						// if (res.data.flag == true) {
-						// 	uni.switchTab({
-						// 		url: '/pages/index/index'
-						// 	});
-						// }
-						code = '';
-						return "ok";
-					}
-					var cs = {};
-					var curl = window.location.href;
-					// alert('curl')
-					// alert(curl)
-					cs.curl = curl;
-					const res1 = await this.$myRequest({
-						url: 'Login/getLoginAuthorize1',
-						data: cs
-					})
-					// alert('turl')
-					// alert(turl)
-					var turl = res1.data.turl;
-					
-					window.location.href =
-						'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4eab2e3b5531d58b&redirect_uri=' + turl +
-						'&response_type=code&scope=snsapi_base&state=abc123#wechat_redirect';
-						
-						
-						
-				} else {
-					const res = await this.$myRequest({
-						url: 'Login/getLoginAuthorize',
-						data: params
-					})
-					// alert('初始化')
-					// alert(res.data.flag)
-					// alert(res.data.msg)
-
-
-				}
-
-			},
-			// end
+			
 
 
 			//短信验证码验证
@@ -232,7 +185,7 @@
 			},
 			async getData(params = {}) {
 				const res = await this.$myRequest({
-					url: 'Login/setSignUp',
+					url: 'Login/setSignUp1',
 					data: params
 				})
 			

+ 1 - 1
pages/siteArchive/siteArchiveAdd/siteArchiveAdd.vue

@@ -459,7 +459,7 @@
 						that.formMess[upimage] = res.tempFilePaths[0];
 						console.log(res.tempFilePaths[0])
 						uni.uploadFile({
-							url: 'https://wx.ewoogi.com/wx/USKYOF/USKYOF.php/Home/MonitoringReporting/setUpload',
+							url: 'https://wx.ewoogi.com/USKYOF/USKYOF.php/Home/MonitoringReporting/setUpload',
 							filePath: that.formMess[upimage],
 							name: 'file',
 							formData: {

+ 2 - 2
util/api.js

@@ -1,5 +1,5 @@
 // const BASE_URL = 'https://iot.usky.cn/USKYOF/USKYOF.php/Home/' //(测试域名)  
-const BASE_URL = 'https://wx.ewoogi.com/wx/USKYOF/USKYOF.php/Home/' //(正式域名新)  
+const BASE_URL = 'https://wx.ewoogi.com/USKYOF/USKYOF.php/Home/' //(正式域名新)  
 // const websiteUrl = 'https://wx.ewoogi.com'
 
 // const BASE_URL='http://https://qhome.usky.cn/USKYOF/USKYOF.php/Home/'
@@ -38,7 +38,7 @@ export const myRequest = (options) => {
 						if (notIndexFail2.includes(options.url) && ua.match(
 								/MicroMessenger/i) == "micromessenger") {
 							// alert('数据拉取失败,请重新进入公众号')
-							// window.location.href = 'https://wx.ewoogi.com/wx/index.html#/pages/index/index';
+							// window.location.href = 'https://wx.ewoogi.com/index.html#/pages/index/index';
 						} else {
 
 							return uni.showToast({

+ 1 - 1
util/jssdk.js

@@ -10,7 +10,7 @@ export function configWeiXin(callback) {
 	console.log(BASE_URL.BASE_URL)
 	// start
 	uni.request({
-		url:"https://wx.ewoogi.com/wx/sign.php",	
+		url:"https://wx.ewoogi.com/sign.php",	
 		// url:"http://s.yxin.tech/sign.php",