@@ -133,13 +133,13 @@ function ddvRestFulApi (path, requests, response) {
133
133
} . bind ( this ) )
134
134
. then ( function ( body ) {
135
135
if ( this . isAuth === true ) {
136
- return ddvRestFulApiNextRun ( this . auth , body , this . requests , this . response , this . request , this . onAccessKey , 0 , ( api . onAccessKeyTrySum || 3 ) , isNative )
136
+ return ddvRestFulApiNextRun ( this . auth , body , this . requests , this . response , this . request , this . onAccessKey , 0 , ( api . onAccessKeyTrySum || 3 ) , isNative , api )
137
137
} else {
138
138
return this . request ( auth . getUri ( ) , body , auth . method , auth . headers , api )
139
- . then ( function ( res ) {
140
- auth = body = void 0
141
- return isNative === true ? res : parseDataByBody ( res )
142
- } )
139
+ . then ( function ( res ) {
140
+ auth = body = void 0
141
+ return isNative === true ? res : parseDataByBody ( res )
142
+ } )
143
143
}
144
144
} . bind ( this ) )
145
145
. then ( function ( res ) {
@@ -183,7 +183,7 @@ function ddvRestFulApi (path, requests, response) {
183
183
} )
184
184
}
185
185
// 运行这个请求
186
- function ddvRestFulApiNextRun ( auth , body , requests , response , requestRun , onAccessKey , tryNum , trySum , isNative ) {
186
+ function ddvRestFulApiNextRun ( auth , body , requests , response , requestRun , onAccessKey , tryNum , trySum , isNative , api ) {
187
187
// options.isServerNode = (requests && response && true) || false
188
188
// ====设定请求对象====
189
189
tryNum = tryNum || 0
@@ -196,7 +196,7 @@ function ddvRestFulApiNextRun (auth, body, requests, response, requestRun, onAcc
196
196
delete auth . headers [ 'Authorization' ]
197
197
}
198
198
auth . headers [ 'Authorization' ] = auth . getAuthString ( )
199
- return requestRun ( auth . getUri ( ) , body , auth . method , auth . headers )
199
+ return requestRun ( auth . getUri ( ) , body , auth . method , auth . headers , api )
200
200
. then ( function ( res ) {
201
201
auth = body = void 0
202
202
return isNative === true ? res : parseDataByBody ( res )
@@ -205,7 +205,7 @@ function ddvRestFulApiNextRun (auth, body, requests, response, requestRun, onAcc
205
205
var r
206
206
if ( parseInt ( e . statusCode ) === 403 && tryNum < trySum ) {
207
207
// 重新运行一次
208
- r = ddvRestFulApiNextRun ( auth , body , requests , response , requestRun , onAccessKey , ( tryNum + 1 ) , trySum , isNative )
208
+ r = ddvRestFulApiNextRun ( auth , body , requests , response , requestRun , onAccessKey , ( tryNum + 1 ) , trySum , isNative , api )
209
209
} else {
210
210
// 还是原路抛出错误
211
211
r = isNative === true ? e : parseDataByBody ( e , true )
0 commit comments