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 @@
...
@@ -3,3 +3,4 @@
.vscode
.vscode
debug.log
debug.log
node_modules
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 = {
...
@@ -8,10 +8,10 @@ const capi = {
receiveEnamePrize
:
{
method
:
'GET'
,
handle
:
'receiveEnamePrize'
},
receiveEnamePrize
:
{
method
:
'GET'
,
handle
:
'receiveEnamePrize'
},
getItemListByItemIds
:
{
method
:
'GET'
,
handle
:
'getItemListByItemIds'
},
getItemListByItemIds
:
{
method
:
'GET'
,
handle
:
'getItemListByItemIds'
},
getCollectGoodsList
:
{
method
:
'GET'
,
handle
:
'getCollectGoodsList'
},
getCollectGoodsList
:
{
method
:
'GET'
,
handle
:
'getCollectGoodsList'
},
doCollectGoodsTask
:
{
method
:
'GET'
,
handle
:
'doCo
llectGoodsTask'
},
doCollectGoodsTask
:
{
method
:
'GET'
,
handle
:
'doCo
mpleteTask'
,
dedaultParams
:
{
taskType
:
'collectGoods'
}
},
doBrowseGoodsTask
:
{
method
:
'GET'
,
handle
:
'do
BrowseGoodsTask'
},
doBrowseGoodsTask
:
{
method
:
'GET'
,
handle
:
'do
CompleteTask'
,
dedaultParams
:
{
taskType
:
'browseGoods'
}
},
doJumpLinkTask
:
{
method
:
'GET'
,
handle
:
'do
JumpLinkTask'
},
doJumpLinkTask
:
{
method
:
'GET'
,
handle
:
'do
CompleteTask'
,
dedaultParams
:
{
taskType
:
'jumpLink'
}
},
doExchangeCreditsTask
:
{
method
:
'GET'
,
handle
:
'do
ExchangeCreditsTask'
},
doExchangeCreditsTask
:
{
method
:
'GET'
,
handle
:
'do
CompleteTask'
,
dedaultParams
:
{
taskType
:
'exchangeCredits'
}
},
getVipInfo
:
{
method
:
'GET'
,
handle
:
'getVipInfo'
}
getVipInfo
:
{
method
:
'GET'
,
handle
:
'getVipInfo'
}
};
};
...
...
c_client/client/tbcc-sdk/lib/utils.js
View file @
d51c4044
...
@@ -68,10 +68,11 @@ export const getRequestParams = value => {
...
@@ -68,10 +68,11 @@ export const getRequestParams = value => {
ext
:
{}
ext
:
{}
}
}
}
else
if
(
typeof
value
===
'object'
)
{
}
else
if
(
typeof
value
===
'object'
)
{
const
{
handle
,
method
=
'POST'
,
...
ext
}
=
value
;
const
{
handle
,
method
=
'POST'
,
dedaultParams
=
{},
...
ext
}
=
value
;
return
{
return
{
handle
,
handle
,
method
,
method
,
dedaultParams
,
ext
:
{
...
ext
}
ext
:
{
...
ext
}
}
}
}
else
{
}
else
{
...
@@ -87,8 +88,8 @@ export const getRequestParams = value => {
...
@@ -87,8 +88,8 @@ export const getRequestParams = value => {
export
const
generateAPI
=
(
apiList
,
request
)
=>
{
export
const
generateAPI
=
(
apiList
,
request
)
=>
{
const
api
=
{};
const
api
=
{};
Object
.
entries
(
apiList
).
forEach
(([
key
,
value
])
=>
{
Object
.
entries
(
apiList
).
forEach
(([
key
,
value
])
=>
{
const
{
handle
,
method
,
ext
}
=
getRequestParams
(
value
);
const
{
handle
,
method
,
ext
,
defaultParams
}
=
getRequestParams
(
value
);
api
[
key
]
=
params
=>
request
(
handle
,
method
,
params
,
ext
);
api
[
key
]
=
params
=>
request
(
handle
,
method
,
Object
.
assign
({},
defaultParams
,
params
)
,
ext
);
});
});
api
.
fn
=
capiFn
(
apiList
,
request
);
api
.
fn
=
capiFn
(
apiList
,
request
);
return
api
;
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