File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,12 @@ var _ = require('underscore');
77 require: false */
88module . exports = function ( AV ) {
99
10- var config = {
10+ // 挂载一些配置
11+ AV . _config = AV . _config || { } ;
12+ _ . extend ( AV . _config , {
1113 cnApiUrl : 'https://api.leancloud.cn' ,
1214 usApiUrl : 'https://us-api.leancloud.cn'
13- } ;
15+ } ) ;
1416
1517 /**
1618 * Contains all AV API classes and functions.
@@ -150,21 +152,21 @@ module.exports = function(AV) {
150152 } ;
151153 }
152154
153- /**
154- *Use china avoscloud API service:https://cn.avoscloud.com
155- */
155+ /**
156+ *Use china avoscloud API service
157+ */
156158 AV . useAVCloudCN = function ( ) {
157- AV . serverURL = config . cnApiUrl ;
159+ AV . serverURL = AV . _config . cnApiUrl ;
158160 } ;
159161
160162 /**
161- *Use USA avoscloud API service:https://us.avoscloud.com
163+ *Use USA avoscloud API service
162164 */
163165 AV . useAVCloudUS = function ( ) {
164- AV . serverURL = config . usApiUrl ;
166+ AV . serverURL = AV . _config . usApiUrl ;
165167 } ;
166168
167-
169+ // 默认使用国内节点
168170 AV . useAVCloudCN ( ) ;
169171
170172 /**
You can’t perform that action at this time.
0 commit comments