소스 검색

修复重复请求

chenxiong 3 년 전
부모
커밋
2c364a852f
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      common/request.js

+ 2 - 0
common/request.js

@@ -21,6 +21,7 @@ export const myRequest = (options) => {
 
 	return new Promise((resolve, reject) => {
 		let token = uni.getStorageSync('token')
+		
 		uni.request({
 			url: BASE_URL + options.url,
 			method: options.method || 'GET',
@@ -79,6 +80,7 @@ export const myRequest = (options) => {
 			const resUser = await myRequest(userInfo)
 			if (resUser.data.code === 200) {
 				store.state.userInfo = resUser.data.data
+				num = 1;
 			}
 			let onset = await myRequest(response)
 			return onset