Skip to content

Commit 45adfda

Browse files
committed
support android dedicated key
1 parent 74d1676 commit 45adfda

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

lib/storage-extra.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ if (process.env.LEANCLOUD_REGION) {
77
AV._config.region = process.env.LEANCLOUD_REGION;
88
}
99

10+
if (process.env.LEANCLOUD_APP_ANDX_KEY) {
11+
AV._config.androidxKey = process.env.LEANCLOUD_APP_ANDX_KEY;
12+
}
13+
1014
if (process.env.LC_API_SERVER) {
1115
AV.setServerURLs(process.env.LC_API_SERVER);
1216
}

middleware/leancloud-headers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ module.exports = function(AV) {
8787
sign = _ref[0];
8888
timestamp = _ref[1];
8989
master = _ref[2];
90-
key = master === 'master' ? AV.masterKey : AV.applicationKey;
90+
key = master === 'master' ? AV.masterKey : ( master === 'ax-sig-1' ? AV._config.androidxKey : AV.applicationKey);
9191
validSign = signByKey(timestamp, key);
9292
if (validSign === sign.toLowerCase()) {
9393
if (master === 'master') {

0 commit comments

Comments
 (0)