Переглянути джерело

抽奖接口加请求头参数

duanshenglang 1 місяць тому
батько
коміт
d4b05363a3
2 змінених файлів з 19 додано та 14 видалено
  1. BIN
      lottery.zip
  2. 19 14
      lottery/index.html

+ 19 - 14
lottery/index.html

@@ -576,24 +576,24 @@
 					this.bId = this.getQueryParam('bId')
 					this.h5Type = this.getQueryParam('h5Type')
 					if (this.h5Type == 19 || !this.h5Type) {
-						// if (this.getQueryParam('openId') || localStorage.getItem('openId')) {
-						// 	if (!this.getQueryParam('externalUserid')) {
-						// 		this.gerQwAuth(this.bId);
-						// 	} else {
-						// 		if (this.getQueryParam('externalUserid') === 'unknown') {
-						// 			this.gerQwCode(this.bId);
-						// 		} else {
+						if (this.getQueryParam('openId') || localStorage.getItem('openId')) {
+							if (!this.getQueryParam('externalUserid')) {
+								this.gerQwAuth(this.bId);
+							} else {
+								if (this.getQueryParam('externalUserid') === 'unknown') {
+									this.gerQwCode(this.bId);
+								} else {
 									this.raffleInfo();
 									this.raffleRecord()
 									this.getCityLevel()
 									this.getAllCar()
 									this.getQyWxSign()
-						// 		}
-						// 	}
-						// } else {
-						// 	// 走授权操作
-						// 	this.getAuth();
-						// }
+								}
+							}
+						} else {
+							// 走授权操作
+							this.getAuth();
+						}
 					} else if (this.h5Type == 20) {
 						// 宝骏云海送祝福
 						var currentQueryParams = window.location.search;
@@ -886,7 +886,12 @@
 							this.currentIndex = 0
 							let externalUserid = this.getQueryParam('externalUserid')
 							let openId = this.getQueryParam('openId') || localStorage.getItem('openId')
-							fetch(this.httpUrl + `/scrm/v1/wxcp-raffle/p/lottery?externalUserid=${externalUserid}&openId=${openId}&raffleId=${this.bId}`)
+							const headers = new Headers();
+							headers.append('police', 110);
+							fetch(this.httpUrl + `/scrm/v1/wxcp-raffle/p/lottery?externalUserid=${externalUserid}&openId=${openId}&raffleId=${this.bId}`, {
+								method: 'GET',
+								headers: headers
+							})
 							  .then(res => {
 									return res.json()
 							  }).then(result => {