From 0823da7786dea054ad62d0fc410b452c75664b30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AD=90=E9=93=AD?= Date: Fri, 15 Nov 2024 10:57:58 +0800 Subject: [PATCH] Md5 ToUpper --- dctw/v1/api/direct/account_type.go | 2 ++ dctw/v1/core/core.go | 2 +- utils/utils.go | 6 ------ 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/dctw/v1/api/direct/account_type.go b/dctw/v1/api/direct/account_type.go index cf552cd..cf23867 100644 --- a/dctw/v1/api/direct/account_type.go +++ b/dctw/v1/api/direct/account_type.go @@ -19,6 +19,8 @@ func (o AccountType) AccountType(account string) AccountType { return AccountTypePhone } else if utils.IsValidQQ(account) { return AccountTypeQQ + } else if utils.IsEmail(account) { + return AccountTypeDefault } return AccountTypeDefault } diff --git a/dctw/v1/core/core.go b/dctw/v1/core/core.go index a2206ad..058f110 100644 --- a/dctw/v1/core/core.go +++ b/dctw/v1/core/core.go @@ -82,7 +82,7 @@ func NewDctWServer(config *DctWConfig, o ...Option) (*DctWServer, error) { func (c *DctWServer) Sign(body, path, timestamp string) string { str := c.Config.AppId + body + path + timestamp + c.Config.AppKey - return utils.Md5ToLower([]byte(str)) + return utils.Md5([]byte(str)) } func (c *DctWServer) BuildAuth(signStr, timestamp string) string { diff --git a/utils/utils.go b/utils/utils.go index 80f6e7f..57a0b30 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -25,15 +25,9 @@ func Load(dir string) ([]string, error) { files = append(files, fmt.Sprintf("%s/%s", dir, info.Name())) } } - return files, nil } -func Md5ToLower(values []byte) string { - hash := md5.Sum(values) - return strings.ToLower(hex.EncodeToString(hash[:])) -} - func Md5(values []byte) string { hash := md5.Sum(values) return strings.ToUpper(hex.EncodeToString(hash[:]))