Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| aaa3d926c9 |
@@ -39,14 +39,15 @@ func (l *apix) GetSign(ctx context.Context, signKey string, params map[string]an
|
|||||||
if signKey == "" {
|
if signKey == "" {
|
||||||
return "", ErrorSignKeyIsEmpty
|
return "", ErrorSignKeyIsEmpty
|
||||||
}
|
}
|
||||||
if len(params) == 0 {
|
|
||||||
return "", ErrorSignParamIsEmpty
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, val := range l.ignoreKeys {
|
for _, val := range l.ignoreKeys {
|
||||||
delete(params, val)
|
delete(params, val)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(params) == 0 {
|
||||||
|
return "", ErrorSignParamIsEmpty
|
||||||
|
}
|
||||||
|
|
||||||
// 排序
|
// 排序
|
||||||
keys := make([]string, len(params))
|
keys := make([]string, len(params))
|
||||||
i := 0
|
i := 0
|
||||||
|
|||||||
+7
-6
@@ -13,14 +13,14 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type platform struct {
|
type platform struct {
|
||||||
ingoreKeys []string
|
ignoreKeys []string
|
||||||
logger loggerx.LoggerInterface
|
logger loggerx.LoggerInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewPlatform(opts ...Option) *platform {
|
func NewPlatform(opts ...Option) *platform {
|
||||||
options := newOptions(opts...)
|
options := newOptions(opts...)
|
||||||
return &platform{
|
return &platform{
|
||||||
ingoreKeys: options.ignoreKeys,
|
ignoreKeys: options.ignoreKeys,
|
||||||
logger: options.logger,
|
logger: options.logger,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -30,12 +30,13 @@ func (l *platform) GetSign(ctx context.Context, signKey string, params map[strin
|
|||||||
if signKey == "" {
|
if signKey == "" {
|
||||||
return "", ErrorSignKeyIsEmpty
|
return "", ErrorSignKeyIsEmpty
|
||||||
}
|
}
|
||||||
if len(params) == 0 {
|
|
||||||
return "", ErrorSignParamIsEmpty
|
for _, val := range l.ignoreKeys {
|
||||||
|
delete(params, val)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, val := range l.ingoreKeys {
|
if len(params) == 0 {
|
||||||
delete(params, val)
|
return "", ErrorSignParamIsEmpty
|
||||||
}
|
}
|
||||||
|
|
||||||
// 排序
|
// 排序
|
||||||
|
|||||||
Reference in New Issue
Block a user