更新密码找回uniapp

This commit is contained in:
hero920103 committed 2026-11-16 17:22:50 +08:00
1 parent 7f9a66da0f
commit 3fdda89833
1304 files changed
+3503 -26132

No files matched your search

-4
View File
@@ -6,7 +6,6 @@ import (
"testing"
)
// TestHashVerifyArgon2id 新算法:哈希后可校验,错误密码拒绝
func TestHashVerifyArgon2id(t *testing.T) {
stored, err := Hash("Passw0rd@2026")
if err != nil {
@@ -26,7 +25,6 @@ func TestHashVerifyArgon2id(t *testing.T) {
}
}
// TestLegacyCompat 旧算法兼容:历史 salt$sha256 串仍可登录,且被标记为需要升级
func TestLegacyCompat(t *testing.T) {
saltHex := "0123456789abcdef0123456789abcdef"
sum := sha256.Sum256([]byte(saltHex + "oldpass"))
@@ -46,7 +44,6 @@ func TestLegacyCompat(t *testing.T) {
}
}
// TestDifferentSaltSamePassword 相同明文两次哈希结果必须不同(盐随机)
func TestDifferentSaltSamePassword(t *testing.T) {
a, _ := Hash("same-password")
b, _ := Hash("same-password")
@@ -58,7 +55,6 @@ func TestDifferentSaltSamePassword(t *testing.T) {
}
}
// TestEmptyPassword 空密码边界
func TestEmptyPassword(t *testing.T) {
if _, err := Hash(" "); err == nil {
t.Fatal("空密码应返回错误")