Skip to content

Commit 2f746cc

Browse files
committed
setRegionServer -> setServerUrlByRegion
1 parent 2da5940 commit 2f746cc

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/request.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ const handleError = (AV, res) => {
211211
return promise;
212212
};
213213

214-
const setRegionServer = (AV, region = 'cn') => {
214+
const setServerUrlByRegion = (AV, region = 'cn') => {
215215
// 服务器请求的节点 host
216216
const API_HOST = {
217217
cn: 'https://api.leancloud.cn',
@@ -281,5 +281,5 @@ const init = (AV) => {
281281
module.exports = {
282282
init,
283283
ajax,
284-
setRegionServer,
284+
setServerUrlByRegion,
285285
};

src/utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ const init = (AV) => {
134134
masterKeyWarn();
135135
}
136136
initialize(options.appId, options.appKey, options.masterKey);
137-
request.setRegionServer(AV, options.region);
137+
request.setServerUrlByRegion(AV, options.region);
138138
AVConfig.disableCurrentUser = options.disableCurrentUser;
139139
} else {
140140
throw new Error('AV.init(): Parameter is not correct.');
@@ -148,7 +148,7 @@ const init = (AV) => {
148148
masterKeyWarn();
149149
}
150150
initialize(...args);
151-
request.setRegionServer(AV, 'cn');
151+
request.setServerUrlByRegion(AV, 'cn');
152152
break;
153153
}
154154
};
@@ -191,7 +191,7 @@ const init = (AV) => {
191191
**/
192192
// TODO: 后续不再暴露此接口
193193
AV.useAVCloudCN = function(){
194-
request.setRegionServer(AV, 'cn');
194+
request.setServerUrlByRegion(AV, 'cn');
195195
console.warn('Do not use AV.useAVCloudCN. Please use AV.init(), you can set the region of server.');
196196
};
197197

@@ -200,7 +200,7 @@ const init = (AV) => {
200200
**/
201201
// TODO: 后续不再暴露此接口
202202
AV.useAVCloudUS = function(){
203-
request.setRegionServer(AV, 'us');
203+
request.setServerUrlByRegion(AV, 'us');
204204
console.warn('Do not use AV.useAVCloudUS. Please use AV.init(), you can set the region of server.');
205205
};
206206

0 commit comments

Comments
 (0)