File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -252,9 +252,10 @@ const refreshServerUrlByRouter = () => {
252252
253253const setServerUrlByRegion = ( region = 'cn' ) => {
254254 getServerURLPromise = new AVPromise ( ) ;
255+ const promise = getServerURLPromise ;
255256 // 如果用户在 init 之前设置了 APIServerURL,则跳过请求 router
256257 if ( AV . _config . APIServerURL ) {
257- getServerURLPromise . resolve ( ) ;
258+ promise . resolve ( ) ;
258259 return ;
259260 }
260261 // if not china server region, do not use router
@@ -266,14 +267,14 @@ const setServerUrlByRegion = (region = 'cn') => {
266267 return refreshServerUrlByRouter ( ) ;
267268 }
268269 } ) . then ( ( ) => {
269- getServerURLPromise . resolve ( ) ;
270+ promise . resolve ( ) ;
270271 } ) . catch ( ( error ) => {
271- getServerURLPromise . reject ( error ) ;
272+ promise . reject ( error ) ;
272273 } ) ;
273274 } else {
274275 AV . _config . region = region ;
275276 AV . _config . APIServerURL = API_HOST [ region ] ;
276- getServerURLPromise . resolve ( ) ;
277+ promise . resolve ( ) ;
277278 }
278279} ;
279280
You can’t perform that action at this time.
0 commit comments