Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinhaitao
taobao-mini-template
Commits
d51c4044
Commit
d51c4044
authored
Dec 03, 2020
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
🎸
完成任务id
parent
daabc8c1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
.gitignore
.gitignore
+2
-1
capi.js
c_client/client/tbcc-sdk/lib/capi.js
+4
-4
utils.js
c_client/client/tbcc-sdk/lib/utils.js
+4
-3
No files found.
.gitignore
View file @
d51c4044
...
...
@@ -3,3 +3,4 @@
.vscode
debug.log
node_modules
dist/
\ No newline at end of file
c_client/client/tbcc-sdk/lib/capi.js
View file @
d51c4044
...
...
@@ -8,10 +8,10 @@ const capi = {
receiveEnamePrize
:
{
method
:
'GET'
,
handle
:
'receiveEnamePrize'
},
getItemListByItemIds
:
{
method
:
'GET'
,
handle
:
'getItemListByItemIds'
},
getCollectGoodsList
:
{
method
:
'GET'
,
handle
:
'getCollectGoodsList'
},
doCollectGoodsTask
:
{
method
:
'GET'
,
handle
:
'doCo
llectGoodsTask'
},
doBrowseGoodsTask
:
{
method
:
'GET'
,
handle
:
'do
BrowseGoodsTask'
},
doJumpLinkTask
:
{
method
:
'GET'
,
handle
:
'do
JumpLinkTask'
},
doExchangeCreditsTask
:
{
method
:
'GET'
,
handle
:
'do
ExchangeCreditsTask'
},
doCollectGoodsTask
:
{
method
:
'GET'
,
handle
:
'doCo
mpleteTask'
,
dedaultParams
:
{
taskType
:
'collectGoods'
}
},
doBrowseGoodsTask
:
{
method
:
'GET'
,
handle
:
'do
CompleteTask'
,
dedaultParams
:
{
taskType
:
'browseGoods'
}
},
doJumpLinkTask
:
{
method
:
'GET'
,
handle
:
'do
CompleteTask'
,
dedaultParams
:
{
taskType
:
'jumpLink'
}
},
doExchangeCreditsTask
:
{
method
:
'GET'
,
handle
:
'do
CompleteTask'
,
dedaultParams
:
{
taskType
:
'exchangeCredits'
}
},
getVipInfo
:
{
method
:
'GET'
,
handle
:
'getVipInfo'
}
};
...
...
c_client/client/tbcc-sdk/lib/utils.js
View file @
d51c4044
...
...
@@ -68,10 +68,11 @@ export const getRequestParams = value => {
ext
:
{}
}
}
else
if
(
typeof
value
===
'object'
)
{
const
{
handle
,
method
=
'POST'
,
...
ext
}
=
value
;
const
{
handle
,
method
=
'POST'
,
dedaultParams
=
{},
...
ext
}
=
value
;
return
{
handle
,
method
,
dedaultParams
,
ext
:
{
...
ext
}
}
}
else
{
...
...
@@ -87,8 +88,8 @@ export const getRequestParams = value => {
export
const
generateAPI
=
(
apiList
,
request
)
=>
{
const
api
=
{};
Object
.
entries
(
apiList
).
forEach
(([
key
,
value
])
=>
{
const
{
handle
,
method
,
ext
}
=
getRequestParams
(
value
);
api
[
key
]
=
params
=>
request
(
handle
,
method
,
params
,
ext
);
const
{
handle
,
method
,
ext
,
defaultParams
}
=
getRequestParams
(
value
);
api
[
key
]
=
params
=>
request
(
handle
,
method
,
Object
.
assign
({},
defaultParams
,
params
)
,
ext
);
});
api
.
fn
=
capiFn
(
apiList
,
request
);
return
api
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment