mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
636 B
35 lines
636 B
package service
|
|
|
|
import (
|
|
"fmt"
|
|
"sort"
|
|
|
|
"github.com/rocboss/paopao-ce/global"
|
|
"github.com/rocboss/paopao-ce/pkg/util"
|
|
)
|
|
|
|
func GetParamSign(param map[string]interface{}, secretKey string) string {
|
|
signRaw := ""
|
|
|
|
rawStrs := []string{}
|
|
for k, v := range param {
|
|
if k != "sign" {
|
|
rawStrs = append(rawStrs, k+"="+fmt.Sprintf("%v", v))
|
|
}
|
|
}
|
|
|
|
sort.Strings(rawStrs)
|
|
for _, v := range rawStrs {
|
|
signRaw += v
|
|
}
|
|
|
|
if global.ServerSetting.RunMode == "debug" {
|
|
global.Logger.Info(map[string]string{
|
|
"signRaw": signRaw,
|
|
"sysSign": util.EncodeMD5(signRaw + secretKey),
|
|
})
|
|
}
|
|
|
|
return util.EncodeMD5(signRaw + secretKey)
|
|
}
|