소스 검색

Merge branch 'master' of http://git.zthymaoyi.com/gongdecai/wangluohuoyun-huozhuapp

gjy 2 년 전
부모
커밋
ad34d6e675
2개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      pages/public/loginOther.vue
  2. 3 1
      util/request.js

+ 1 - 0
pages/public/loginOther.vue

@@ -111,6 +111,7 @@
 				})
 				})
 			},
 			},
 			gocode() {
 			gocode() {
+				let that = this
 				if (this.phone.length == 11 && /^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.phone)) {
 				if (this.phone.length == 11 && /^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.phone)) {
 					that.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {
 					that.$request.baseRequest('get', '/cargoOwnerInfo/firstAuthentication', {
 						phone: this.phone,
 						phone: this.phone,

+ 3 - 1
util/request.js

@@ -6,6 +6,7 @@ const baseRequest = (method, url, data, header) => {
 	if (header) {
 	if (header) {
 		contentheader = header
 		contentheader = header
 	}
 	}
+	let userInfo = uni.getStorageSync('userInfo');
 	let baseDefaultOpts = {
 	let baseDefaultOpts = {
 		url: baseUrl + url,
 		url: baseUrl + url,
 		// 请求接口地址
 		// 请求接口地址
@@ -14,7 +15,8 @@ const baseRequest = (method, url, data, header) => {
 		method: method,
 		method: method,
 		// 配置请求类型
 		// 配置请求类型
 		header: {
 		header: {
-			'content-type': contentheader //'application/x-www-form-urlencoded; charset=UTF-8',
+			'content-type': contentheader, //'application/x-www-form-urlencoded; charset=UTF-8',
+			'accessToken':userInfo.accessToken
 		}
 		}
 	}
 	}
 	let promise = new Promise(function(resolve, reject) {
 	let promise = new Promise(function(resolve, reject) {