Skip to content

Commit b8efd7c

Browse files
committed
AV._config.isUsingMasterKey -> AV._useMasterKey
1 parent e305fc8 commit b8efd7c

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

src/utils.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ module.exports = function(AV) {
2727
APIServerURL: AVConfig.APIServerURL || '',
2828

2929
// 当前是否为 nodejs 环境
30-
isNode: false,
31-
32-
// 是否启用 masterKey
33-
isUsingMasterKey: false
30+
isNode: false
3431
});
3532

3633
/**
@@ -111,6 +108,7 @@ module.exports = function(AV) {
111108
AV.applicationId = appId;
112109
AV.applicationKey = appKey;
113110
AV.masterKey = masterKey;
111+
AV._useMasterKey = false;
114112
};
115113

116114
const setRegionServer = (region) => {
@@ -177,7 +175,7 @@ module.exports = function(AV) {
177175
* </p>
178176
*/
179177
AV.Cloud.useMasterKey = function() {
180-
AVConfig.isUsingMasterKey = true;
178+
AV._useMasterKey = true;
181179
};
182180
}
183181

@@ -385,7 +383,7 @@ module.exports = function(AV) {
385383
if(!AV._isNullOrUndefined(AV.applicationProduction)) {
386384
dataObject._ApplicationProduction = AV.applicationProduction;
387385
}
388-
if(AVConfig.isUsingMasterKey)
386+
if(AV._useMasterKey)
389387
dataObject._MasterKey = AV.masterKey;
390388
dataObject._ClientVersion = AV.VERSION;
391389
// Pass the session token on every request.

test/cloud.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ describe("AV.Cloud", function() {
77
originalServerURL = AV._config.APIServerURL;
88
originalAppId = AV.applicationId;
99
originalAppKey = AV.applicationKey;
10-
originalUseMasterKey = AV._config.isUsingMasterKey;
10+
originalUseMasterKey = AV._useMasterKey;
1111

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

1717
AV.User._currentUser = null;
1818
});
@@ -119,6 +119,6 @@ describe("AV.Cloud", function() {
119119
AV._config.APIServerURL = originalServerURL;
120120
AV.applicationId = originalAppId;
121121
AV.applicationKey = originalAppKey;
122-
AV._config.isUsingMasterKey = originalUseMasterKey;
122+
AV._useMasterKey = originalUseMasterKey;
123123
});
124124
});

test/file_blob.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
function upload (){
7070
AV._config.APIServerURL="https://cn-stg1.avoscloud.com";
7171
AV.init('mxrb5nn3qz7drek0etojy5lh4yrwjnk485lqajnsgjwfxrb5', 'd7sbus0d81mrum4tko4t8gl74b27vl0rh762ff7ngrb6ymmq', 'l0n9wu3kwnrtf2cg1b6w2l87nphzpypgff6240d0lxui2mm4');
72-
AV._config.isUsingMasterKey = true;
72+
AV._useMasterKey = true;
7373
AV.setProduction(true);
7474

7575
var name = "photo.png";

test/file_form.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
function upload (){
1919
AV._config.APIServerURL="https://cn.avoscloud.com";
2020
AV.init('u8d277gijfac1ysldfyb92zn9fwhxsiecjs3wnrnj4yi7i00', 'nblwmv06uzbjp170pm1zw3umhrbhs75wp6djgutcglh5sopr', 'c2cbbq9fnrewpvtwm7lm25exs62hk0tnkmbs4q16c4podmdc');
21-
AV._config.isUsingMasterKey = true;
21+
AV._useMasterKey = true;
2222

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

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ AV.init({
1414
masterKey: 'l0n9wu3kwnrtf2cg1b6w2l87nphzpypgff6240d0lxui2mm4'
1515
});
1616
AV.setProduction(true);
17-
AV._config.isUsingMasterKey = true;
17+
AV._useMasterKey = true;

0 commit comments

Comments
 (0)