Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tbcc-sdk-ts
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
qinhaitao
tbcc-sdk-ts
Commits
09ae4bcf
Commit
09ae4bcf
authored
Mar 25, 2021
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:
🐛
bug
parent
f3173bd8
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
53 additions
and
34 deletions
+53
-34
tb.js
lib/core/tb.js
+1
-1
tb.js.map
lib/core/tb.js.map
+1
-1
tbFn.js
lib/core/tbFn.js
+19
-11
tbFn.js.map
lib/core/tbFn.js.map
+1
-1
package.json
package.json
+1
-1
tb.ts
src/core/tb.ts
+1
-1
tbFn.ts
src/core/tbFn.ts
+26
-17
index.d.ts
src/typing/index.d.ts
+3
-1
No files found.
lib/core/tb.js
View file @
09ae4bcf
...
...
@@ -140,7 +140,7 @@ var checkShopFavoredStatus = function (sellerId) { return __awaiter(void 0, void
return
[
4
/*yield*/
,
helpers_1
.
promisifyApiToTb
(
'checkShopFavoredStatus'
,
{
id
:
+
sellerId
})];
case
1
:
result
=
_a
.
sent
();
if
(
result
===
null
||
result
===
void
0
?
void
0
:
result
.
isFavor
)
if
(
(
result
===
null
||
result
===
void
0
?
void
0
:
result
.
isFavor
)
!==
undefined
)
return
[
2
/*return*/
,
result
.
isFavor
];
if
(
result
===
'checkShopFavoredStatus 仅支持真机调用,请在手机淘宝中运行'
)
return
[
2
/*return*/
,
true
];
...
...
lib/core/tb.js.map
View file @
09ae4bcf
This diff is collapsed.
Click to expand it.
lib/core/tbFn.js
View file @
09ae4bcf
...
...
@@ -220,10 +220,15 @@ exports.uploadImage = uploadImage;
*/
var
getAuthUserInfo
=
function
()
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
// @ts-ignore
my
.
getAuthUserInfo
({
success
:
function
(
userInfo
)
{
resolve
(
userInfo
);
},
fail
:
function
(
err
)
{
my
.
authorize
({
scopes
:
'scope.userInfo'
,
success
:
function
()
{
console
.
log
(
'执行 my.authorize'
);
// @ts-ignore
my
.
getAuthUserInfo
({
success
:
function
(
userInfo
)
{
...
...
@@ -238,6 +243,9 @@ var getAuthUserInfo = function () {
reject
(
err
);
}
});
}
});
// @ts-ignore
});
};
exports
.
getAuthUserInfo
=
getAuthUserInfo
;
...
...
lib/core/tbFn.js.map
View file @
09ae4bcf
This diff is collapsed.
Click to expand it.
package.json
View file @
09ae4bcf
{
"name"
:
"tbcc-sdk-ts"
,
"version"
:
"1.0.
2
"
,
"version"
:
"1.0.
4
"
,
"description"
:
""
,
"main"
:
"lib/index.js"
,
"scripts"
:
{
...
...
src/core/tb.ts
View file @
09ae4bcf
...
...
@@ -75,7 +75,7 @@ export const checkShopFavoredStatus = async (sellerId: number) => {
return
false
;
}
let
result
:
{
isFavor
?:
boolean
}
=
await
promisifyApiToTb
(
'checkShopFavoredStatus'
,{
id
:
+
sellerId
})
if
(
result
?.
isFavor
)
return
result
.
isFavor
if
(
result
?.
isFavor
!==
undefined
)
return
result
.
isFavor
if
(
result
===
'checkShopFavoredStatus 仅支持真机调用,请在手机淘宝中运行'
)
return
true
return
result
};
...
...
src/core/tbFn.ts
View file @
09ae4bcf
...
...
@@ -149,10 +149,15 @@ export const uploadImage = async (opts = {}) => {
*/
export
const
getAuthUserInfo
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
// @ts-ignore
my
.
getAuthUserInfo
({
success
:
userInfo
=>
{
resolve
(
userInfo
);
},
fail
:
err
=>
{
my
.
authorize
({
scopes
:
'scope.userInfo'
,
success
:
()
=>
{
console
.
log
(
'执行 my.authorize'
)
// @ts-ignore
my
.
getAuthUserInfo
({
success
:
userInfo
=>
{
...
...
@@ -167,6 +172,10 @@ export const getAuthUserInfo = () => {
reject
(
err
);
}
});
}
});
// @ts-ignore
});
};
/**
...
...
src/typing/index.d.ts
View file @
09ae4bcf
...
...
@@ -76,3 +76,5 @@ interface ISkuInfo {
skuId
:
string
quantity
:
string
}
declare
var
my
:
any
\ No newline at end of file
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