提交 e712bfdb 编写于 作者: Q Quinton.Xu

fix typo

上级 b0379639
......@@ -36,7 +36,7 @@ Node.js >= 6.0.0 required.
configServerUrl: 'http://example.com',
appId: '<appId>',
clusterName: 'default',
namespaceName: [ 'namespaceName1', 'namespaceName2' ],
namespaceName: [ 'namespaceName1', 'namespaceName2' ], // n1的配置会被n2配置覆盖
// clientIp: '',
};
const result = await apollo.remoteConfigServiceFromCache(config);
......@@ -48,8 +48,9 @@ Node.js >= 6.0.0 required.
configServerUrl: 'http://example.com',
appId: '<appId>',
clusterName: 'default',
namespaceName: [ 'namespaceName1', 'namespaceName2' ],
// clientIp: '',
namespaceName: [ 'namespaceName1', 'namespaceName2' ], // n1的配置会被n2配置覆盖
// clientIp: '', // optional
// releaseKey: '', // optional
};
const result = await apollo.remoteConfigServiceSikpCache(config);
```
......@@ -60,7 +61,7 @@ Node.js >= 6.0.0 required.
configServerUrl: 'http://example.com',
appId: '<appId>',
clusterName: 'default',
namespaceName: '',
namespaceName: '', //no surport multi namespace name, optional
apolloEnv: 'dev',
token: '<apollo access token>'
// clientIp: '',
......
......@@ -91,9 +91,10 @@ module.exports = {
assert(appId, 'appId is required');
assert(clusterName, 'clusterName is required');
if (Array.isArray(namespaceName)) {
if (namespaceName.length === 0) return [`${configServerUrl}/configfiles/json/${appId}/${clusterName}/application?ip=${clientIp}`];
return namespaceName.map(n => `${configServerUrl}/configfiles/json/${appId}/${clusterName}/${namespaceName}?ip=${clientIp}`);
} else {
return Arrary.from(`${configServerUrl}/configfiles/json/${appId}/${clusterName}/${namespaceName}?ip=${clientIp}`);
return [`${configServerUrl}/configfiles/json/${appId}/${clusterName}/${namespaceName}?ip=${clientIp}`];
}
},
......@@ -105,9 +106,11 @@ module.exports = {
assert(appId, 'appId is required');
assert(clusterName, 'clusterName is required');
if (Array.isArray(namespaceName)) {
console.log( [`${configServerUrl}/configs/${appId}/${clusterName}/application?releaseKey=${releaseKey}&ip=${clientIp}`])
if (namespaceName.length === 0) return [`${configServerUrl}/configs/${appId}/${clusterName}/application?releaseKey=${releaseKey}&ip=${clientIp}`];
return namespaceName.map(n => `${configServerUrl}/configs/${appId}/${clusterName}/${n}?releaseKey=${releaseKey}&ip=${clientIp}`);
} else {
return Arrary.from(`${configServerUrl}/configs/${appId}/${clusterName}/${namespaceName}?releaseKey=${releaseKey}&ip=${clientIp}`);
return [`${configServerUrl}/configs/${appId}/${clusterName}/${namespaceName}?releaseKey=${releaseKey}&ip=${clientIp}`];
}
}
};
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册