Skip to content

Commit 5d97c85

Browse files
committed
fix(app-router): add some magic
1 parent d30e3d2 commit 5d97c85

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ release.sh
66
coverage
77
*.swp
88
dist/js-sdk-api-docs
9+
.idea

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
},
1313
"dependencies": {
1414
"debug": "^2.2.0",
15-
"form-data": "^1.0.0-rc4",
1615
"localstorage-memory": "^1.0.1",
1716
"md5": "^2.0.0",
1817
"qiniu": "6.1.3",

src/utils.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ const init = (AV) => {
137137
}
138138
AVConfig.APIServerURL = API_HOST[region];
139139
if (region === 'cn') {
140+
// TODO: remove appId match hack
141+
if (AV.applicationId.indexOf('-9Nh9j0Va') !== -1) {
142+
AVConfig.APIServerURL = 'https://e1-api.leancloud.cn';
143+
}
140144
Cache.get('APIServerURL').then(cachedServerURL => {
141145
if (cachedServerURL) {
142146
return cachedServerURL;

test/file.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,16 @@
22

33
describe('files', function() {
44
describe('Saving base64', function() {
5-
it('should be saved', function(done) {
5+
it('should be saved', function() {
66
var base64 = 'd29ya2luZyBhdCBhdm9zY2xvdWQgaXMgZ3JlYXQh';
77
var file = new AV.File('myfile.txt', { base64: base64 });
88
file.metaData('format', 'txt file');
99
file.setACL(new AV.ACL());
10-
file.save().then(function() {
10+
return file.save().then(function() {
1111
expect(file.ownerId()).to.be.ok();
1212
expect(file.id).to.be.ok();
1313
expect(file.metaData('format')).to.be('txt file');
14-
15-
file.destroy().then(function() {
16-
done();
17-
}, function(error) {
18-
done(error);
19-
});
20-
}, function(error) {
21-
done(error);
14+
return file.destroy();
2215
});
2316
});
2417
});

0 commit comments

Comments
 (0)