feat: 根据 X-App-Id 判断是否裁剪套餐列表,老版客户端去掉最后一个
Build docker and publish / build (20.15.1) (push) Successful in 7m37s
Build docker and publish / build (20.15.1) (push) Successful in 7m37s
This commit is contained in:
@@ -7,8 +7,7 @@ import (
|
||||
"github.com/perfect-panel/server/internal/model/subscribe"
|
||||
"github.com/perfect-panel/server/internal/svc"
|
||||
"github.com/perfect-panel/server/internal/types"
|
||||
// "github.com/perfect-panel/server/pkg/apiversion"
|
||||
// "github.com/perfect-panel/server/pkg/constant"
|
||||
"github.com/perfect-panel/server/pkg/constant"
|
||||
"github.com/perfect-panel/server/pkg/logger"
|
||||
"github.com/perfect-panel/server/pkg/tool"
|
||||
"github.com/perfect-panel/server/pkg/xerr"
|
||||
@@ -60,12 +59,11 @@ func (l *QuerySubscribeListLogic) QuerySubscribeList(req *types.QuerySubscribeLi
|
||||
list[i] = sub
|
||||
}
|
||||
|
||||
// 老版本(无 api-header)去掉排序最后一个套餐
|
||||
// rawVersion, _ := l.ctx.Value(constant.CtxKeyAPIHeaderRaw).(string)
|
||||
// useLatest := apiversion.UseLatest(rawVersion, apiversion.DefaultThreshold)
|
||||
// if !useLatest && len(list) > 0 {
|
||||
// list = list[:len(list)-1]
|
||||
// }
|
||||
// 老版本客户端(无 X-App-Id)去掉排序最后一个套餐
|
||||
hasAppId, _ := l.ctx.Value(constant.CtxKeyHasAppId).(bool)
|
||||
if !hasAppId && len(list) > 0 {
|
||||
list = list[:len(list)-1]
|
||||
}
|
||||
|
||||
resp.List = list
|
||||
resp.Total = int64(len(list))
|
||||
|
||||
Reference in New Issue
Block a user