更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -11,7 +11,6 @@ import (
|
||||
"server/services/wechatmp"
|
||||
)
|
||||
|
||||
// sign 复刻微信签名算法:sha1(sort(token, timestamp, nonce))
|
||||
func sign(token, timestamp, nonce string) string {
|
||||
arr := []string{token, timestamp, nonce}
|
||||
sort.Strings(arr)
|
||||
@@ -19,7 +18,6 @@ func sign(token, timestamp, nonce string) string {
|
||||
return hex.EncodeToString(sum[:])
|
||||
}
|
||||
|
||||
// signMsg 复刻加密消息签名:sha1(sort(token, timestamp, nonce, encrypt))
|
||||
func signMsg(token, timestamp, nonce, encrypt string) string {
|
||||
arr := []string{token, timestamp, nonce, encrypt}
|
||||
sort.Strings(arr)
|
||||
@@ -27,7 +25,6 @@ func signMsg(token, timestamp, nonce, encrypt string) string {
|
||||
return hex.EncodeToString(sum[:])
|
||||
}
|
||||
|
||||
// 明文 / 兼容模式:签名正确时原样回显 echostr
|
||||
func TestVerifyPushEchostrPlain(t *testing.T) {
|
||||
cfgs := []wechatmini.PushConfig{
|
||||
{AppID: "wxApp", Token: "tokenPlain", EncryptMode: wechatmp.EncryptModePlain, DataFormat: wechatmini.DataFormatXML},
|
||||
@@ -50,7 +47,6 @@ func TestVerifyPushEchostrPlain(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// 安全模式:echostr 为密文,验签 + 解密后回显明文
|
||||
func TestVerifyPushEchostrSafeMode(t *testing.T) {
|
||||
key := wechatmini.GeneratePushAESKey()
|
||||
cfgs := []wechatmini.PushConfig{
|
||||
|
||||
Reference in new issue
Block a user