Commit 58bbff94 authored by qinhaitao's avatar qinhaitao

feat: 🎸 noVip

parent e63ac6e0
...@@ -2,3 +2,4 @@ ...@@ -2,3 +2,4 @@
export * from './check' export * from './check'
export * from './services' export * from './services'
export * from './noCatch' export * from './noCatch'
export * from './noVip'
/** @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 }])
}
}
...@@ -19,7 +19,7 @@ async function initBaseInfo(context: IContext<IParams>, baseInfos: IControllerIn ...@@ -19,7 +19,7 @@ async function initBaseInfo(context: IContext<IParams>, baseInfos: IControllerIn
baseInfos.activityUserNick = userNick 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) const vipInfo = await userService.getShopVip(baseInfos.session, formatVipCbUrl(context), baseInfos.activityUserNick)
baseInfos.vipInfo = vipInfo baseInfos.vipInfo = vipInfo
} }
......
...@@ -29,6 +29,7 @@ interface IControllerInfos { ...@@ -29,6 +29,7 @@ interface IControllerInfos {
session: string session: string
activityUserNick: string // 活动创建账号昵称 activityUserNick: string // 活动创建账号昵称
noCatch?: boolean noCatch?: boolean
noVip?: boolean
} }
interface IVipInfo { interface IVipInfo {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment