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
58bbff94
Commit
58bbff94
authored
Oct 13, 2020
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
🎸
noVip
parent
e63ac6e0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
1 deletion
+12
-1
index.ts
v2.0/src/decorator/index.ts
+1
-0
noVip.ts
v2.0/src/decorator/noVip.ts
+9
-0
services.ts
v2.0/src/decorator/services.ts
+1
-1
index.d.ts
v2.0/src/typings/index.d.ts
+1
-0
No files found.
v2.0/src/decorator/index.ts
View file @
58bbff94
...
...
@@ -2,3 +2,4 @@
export
*
from
'./check'
export
*
from
'./services'
export
*
from
'./noCatch'
export
*
from
'./noVip'
v2.0/src/decorator/noVip.ts
0 → 100644
View file @
58bbff94
/** @format */
export
const
noVip
=
(
target
:
any
,
name
:
string
,
descriptor
:
PropertyDescriptor
)
=>
{
const
method
=
descriptor
.
value
descriptor
.
value
=
async
function
(...
args
:
any
[])
{
const
[
context
,
otherArgs
=
{}]
=
args
return
method
.
apply
(
this
,
[
context
,
{
...
otherArgs
,
noVip
:
true
}])
}
}
v2.0/src/decorator/services.ts
View file @
58bbff94
...
...
@@ -19,7 +19,7 @@ async function initBaseInfo(context: IContext<IParams>, baseInfos: IControllerIn
baseInfos
.
activityUserNick
=
userNick
}
if
(
!
baseInfos
.
vipInfo
&&
handler
!==
'getVipInfo'
)
{
if
(
!
baseInfos
.
vipInfo
&&
handler
!==
'getVipInfo'
&&
!
baseInfos
.
noVip
)
{
const
vipInfo
=
await
userService
.
getShopVip
(
baseInfos
.
session
,
formatVipCbUrl
(
context
),
baseInfos
.
activityUserNick
)
baseInfos
.
vipInfo
=
vipInfo
}
...
...
v2.0/src/typings/index.d.ts
View file @
58bbff94
...
...
@@ -29,6 +29,7 @@ interface IControllerInfos {
session
:
string
activityUserNick
:
string
// 活动创建账号昵称
noCatch
?:
boolean
noVip
?:
boolean
}
interface
IVipInfo
{
...
...
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