@@ -24,13 +24,13 @@ module.exports = function(AV) {
2424 region : 'cn' ,
2525
2626 // 服务器的 URL,默认初始化时被设置为大陆节点地址
27- apiServerUrl : AVConfig . apiServerUrl || '' ,
27+ APIServerURL : AVConfig . APIServerURL || '' ,
2828
2929 // 当前是否为 nodejs 环境
3030 isNode : false ,
3131
3232 // 是否启用 masterKey
33- isUseMasterKey : false
33+ isUsingMasterKey : false
3434 } ) ;
3535
3636 /**
@@ -124,8 +124,8 @@ module.exports = function(AV) {
124124 AVConfig . region = 'cn' ;
125125 break ;
126126 }
127- if ( ! AVConfig . apiServerUrl ) {
128- AVConfig . apiServerUrl = API_HOST [ AVConfig . region ] ;
127+ if ( ! AVConfig . APIServerURL ) {
128+ AVConfig . APIServerURL = API_HOST [ AVConfig . region ] ;
129129 }
130130 } ;
131131
@@ -156,7 +156,7 @@ module.exports = function(AV) {
156156 // 兼容旧版本的初始化方法
157157 case 2 :
158158 case 3 :
159- console . warn ( 'Please use AV.init() replace AV.initialize() .' ) ;
159+ console . warn ( 'Please use AV.init() to replace AV.initialize() .' ) ;
160160 if ( ! AVConfig . isNode && args . length === 3 ) {
161161 throw new Error ( 'AV.init(): Master Key is only used in Node.js.' ) ;
162162 }
@@ -177,7 +177,7 @@ module.exports = function(AV) {
177177 * </p>
178178 */
179179 AV . Cloud . useMasterKey = function ( ) {
180- AVConfig . isUseMasterKey = true ;
180+ AVConfig . isUsingMasterKey = true ;
181181 } ;
182182 }
183183
@@ -354,24 +354,24 @@ module.exports = function(AV) {
354354 }
355355
356356 // 兼容 AV.serverURL 旧方式设置 API Host,后续去掉
357- let apiUrl = AV . serverURL || AVConfig . apiServerUrl ;
357+ let apiURL = AV . serverURL || AVConfig . APIServerURL ;
358358 if ( AV . serverURL ) {
359- AVConfig . apiServerUrl = AV . serverURL ;
360- console . warn ( 'Please use AV._config.apiServerUrl replace AV.serverURL .' ) ;
359+ AVConfig . APIServerURL = AV . serverURL ;
360+ console . warn ( 'Please use AV._config.APIServerURL to replace AV.serverURL .' ) ;
361361 }
362- if ( apiUrl . charAt ( apiUrl . length - 1 ) !== "/" ) {
363- apiUrl += "/" ;
362+ if ( apiURL . charAt ( apiURL . length - 1 ) !== "/" ) {
363+ apiURL += "/" ;
364364 }
365- apiUrl += "1.1/" + route ;
365+ apiURL += "1.1/" + route ;
366366 if ( className ) {
367- apiUrl += "/" + className ;
367+ apiURL += "/" + className ;
368368 }
369369 if ( objectId ) {
370- apiUrl += "/" + objectId ;
370+ apiURL += "/" + objectId ;
371371 }
372372 if ( ( route === 'users' || route === 'classes' ) && dataObject && dataObject . _fetchWhenSave ) {
373373 delete dataObject . _fetchWhenSave ;
374- apiUrl += '?new=true' ;
374+ apiURL += '?new=true' ;
375375 }
376376
377377 dataObject = _ . clone ( dataObject || { } ) ;
@@ -385,7 +385,7 @@ module.exports = function(AV) {
385385 if ( ! AV . _isNullOrUndefined ( AV . applicationProduction ) ) {
386386 dataObject . _ApplicationProduction = AV . applicationProduction ;
387387 }
388- if ( AVConfig . isUseMasterKey )
388+ if ( AVConfig . isUsingMasterKey )
389389 dataObject . _MasterKey = AV . masterKey ;
390390 dataObject . _ClientVersion = AV . VERSION ;
391391 // Pass the session token on every request.
@@ -398,7 +398,7 @@ module.exports = function(AV) {
398398 dataObject . _InstallationId = _InstallationId ;
399399
400400 var data = JSON . stringify ( dataObject ) ;
401- return AV . _ajax ( method , apiUrl , data ) . then ( null , function ( response ) {
401+ return AV . _ajax ( method , apiURL , data ) . then ( null , function ( response ) {
402402 // Transform the error into an instance of AV.Error by trying to parse
403403 // the error string as JSON.
404404 var error ;
0 commit comments