Skip to content

Commit

Permalink
修复v2版本客户端判断不准确的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Airwin committed Nov 1, 2016
1 parent 8730dc2 commit 48143ba
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 18 deletions.
12 changes: 7 additions & 5 deletions lib/HuobanAppSDK.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/HuobanAppSDK.min.js

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions lib/HuobanAppSDK_QR.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/HuobanAppSDK_QR.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "huoban-app-sdk",
"version": "1.1.9",
"version": "1.1.10",
"description": "for building applications on https://app.huoban.com",
"main": "lib/HuobanAppSDK.js",
"scripts": {
Expand Down
9 changes: 6 additions & 3 deletions src/client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ export default class Client extends Channel {
space_id: app.space_id
}
let isV2 = this._checkUp2V2()
if (filters && !isV2) {
params.filters = cvFiltersToV1(filters)
if (filters) {
params.filters = isV2 ? filters : cvFiltersToV1(filters)
}
if (viewId) {
if (typeof viewId == 'function') {
Expand Down Expand Up @@ -497,11 +497,14 @@ export default class Client extends Channel {
}

_checkUp2V2() {
let upgraded = false
let upgraded

if (isClientAndroid) {
upgraded = verCmp(this._version, '2.4.0') >= 0
} else if (isClientIOS) {
upgraded = verCmp(this._version, '140') >= 0
} else {
upgraded = verCmp(this._version, '4.1') >= 0
}

return upgraded
Expand Down

0 comments on commit 48143ba

Please sign in to comment.