Skip to content

Commit

Permalink
code 2000 opt
Browse files Browse the repository at this point in the history
  • Loading branch information
co2color authored and liangpengfei committed Jan 3, 2023
1 parent 8f457f0 commit e40fc5d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cocoscreatorv3.5.0-demo/assets/Scripts/turbo.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/turbo.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "turbo-sdk-minigame",
"version": "3.3.2",
"version": "3.3.3",
"description": "turbo minigame sdk",
"main": "turbo.min.js",
"scripts": {
Expand Down
17 changes: 13 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,11 @@ const sendStrategy = {
method: "POST",
header,
data: parmas,
success: function () {
resolve("");
success: function (res) {
resolve({
...res,
count: parmas.event_list.length,
});
},
fail: function () {
reject("");
Expand All @@ -293,8 +296,14 @@ const sendStrategy = {
stack.push(this.requestAll(params));
}
Promise.all(stack)
.then(() => {
option.success(option.len);
.then((res) => {
for (let i = 0; i < res.length; i++) {
if (res[i].data.code === 2000) {
option.success(0);
} else {
option.success(res[i].count);
}
}
})
.catch(() => {
option.fail();
Expand Down
2 changes: 1 addition & 1 deletion src/lib/eventproperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const eventProperty = {
$model: info.model,
$brand: String(info.brand).toLocaleUpperCase(),
$manufacturer: info.brand,
$lib_version: "3.3.2",
$lib_version: "3.3.3",
$lib: "CocosCreator",
};
for (let item in temp_systeminfo) {
Expand Down

0 comments on commit e40fc5d

Please sign in to comment.