Skip to content

Commit e305fc8

Browse files
committed
fix typo
1 parent 5d2a149 commit e305fc8

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
lines changed

src/utils.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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;

test/cloud.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ describe("AV.Cloud", function() {
44
var originalServerURL, originalAppId, originalAppKey, originalUseMasterKey;
55

66
before(function() {
7-
originalServerURL = AV._config.apiServerUrl;
7+
originalServerURL = AV._config.APIServerURL;
88
originalAppId = AV.applicationId;
99
originalAppKey = AV.applicationKey;
10-
originalUseMasterKey = AV._config.isUseMasterKey;
10+
originalUseMasterKey = AV._config.isUsingMasterKey;
1111

12-
AV._config.apiServerUrl = 'https://leancloud.cn'
12+
AV._config.APIServerURL = 'https://leancloud.cn'
1313
AV.applicationId = '4h2h4okwiyn8b6cle0oig00vitayum8ephrlsvg7xo8o19ne';
1414
AV.applicationKey = '3xjj1qw91cr3ygjq9lt0g8c3qpet38rrxtwmmp0yffyoy2t4';
15-
AV._config.isUseMasterKey = false;
15+
AV._config.isUsingMasterKey = false;
1616

1717
AV.User._currentUser = null;
1818
});
@@ -116,9 +116,9 @@ describe("AV.Cloud", function() {
116116
});
117117

118118
after(function() {
119-
AV._config.apiServerUrl = originalServerURL;
119+
AV._config.APIServerURL = originalServerURL;
120120
AV.applicationId = originalAppId;
121121
AV.applicationKey = originalAppKey;
122-
AV._config.isUseMasterKey = originalUseMasterKey;
122+
AV._config.isUsingMasterKey = originalUseMasterKey;
123123
});
124124
});

test/file_blob.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767
return bb.getBlob(mimeString);
6868
};
6969
function upload (){
70-
AV._config.apiServerUrl="https://cn-stg1.avoscloud.com";
70+
AV._config.APIServerURL="https://cn-stg1.avoscloud.com";
7171
AV.init('mxrb5nn3qz7drek0etojy5lh4yrwjnk485lqajnsgjwfxrb5', 'd7sbus0d81mrum4tko4t8gl74b27vl0rh762ff7ngrb6ymmq', 'l0n9wu3kwnrtf2cg1b6w2l87nphzpypgff6240d0lxui2mm4');
72-
AV._config.isUseMasterKey = true;
72+
AV._config.isUsingMasterKey = true;
7373
AV.setProduction(true);
7474

7575
var name = "photo.png";

test/file_form.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
<script src="../dist/av-mini.js"></script>
1717
<script>
1818
function upload (){
19-
AV._config.apiServerUrl="https://cn.avoscloud.com";
19+
AV._config.APIServerURL="https://cn.avoscloud.com";
2020
AV.init('u8d277gijfac1ysldfyb92zn9fwhxsiecjs3wnrnj4yi7i00', 'nblwmv06uzbjp170pm1zw3umhrbhs75wp6djgutcglh5sopr', 'c2cbbq9fnrewpvtwm7lm25exs62hk0tnkmbs4q16c4podmdc');
21-
AV._config.isUseMasterKey = true;
21+
AV._config.isUsingMasterKey = true;
2222

2323
var fileUploadControl = document.getElementById ('profilePhotoFileUpload');
2424
console.log(fileUploadControl);

test/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ if (typeof require !== 'undefined') {
77
GLOBAL.AV = require('../dist/node/av');
88
}
99

10-
AV._config.apiServerUrl = 'https://cn-stg1.avoscloud.com';
10+
AV._config.APIServerURL = 'https://cn-stg1.avoscloud.com';
1111
AV.init({
1212
appId: 'mxrb5nn3qz7drek0etojy5lh4yrwjnk485lqajnsgjwfxrb5',
1313
appKey: 'd7sbus0d81mrum4tko4t8gl74b27vl0rh762ff7ngrb6ymmq',
1414
masterKey: 'l0n9wu3kwnrtf2cg1b6w2l87nphzpypgff6240d0lxui2mm4'
1515
});
1616
AV.setProduction(true);
17-
AV._config.isUseMasterKey = true;
17+
AV._config.isUsingMasterKey = true;

0 commit comments

Comments
 (0)