Explorar el Código

修复新用户注册salt乱码问题

NorthLan hace 7 años
padre
commit
af176a8af0

+ 2 - 2
zen-api/src/main/kotlin/com/gxzc/zen/api/sys/service/impl/SysUserServiceImpl.kt

@@ -83,7 +83,7 @@ class SysUserServiceImpl : ServiceImpl<SysUserMapper, SysUser>(), ISysUserServic
                 throw ZenException(ZenExceptionEnum.REG_PASSWORD_ERROR)
             }
 
-            val salt = RandomStringUtils.random(9)!!
+            val salt = RandomStringUtils.randomAlphanumeric(9)!!
             entity.salt = salt
             entity.password = MD5Salt.md5SaltEncode(salt, entity.password!!)
 
@@ -128,7 +128,7 @@ class SysUserServiceImpl : ServiceImpl<SysUserMapper, SysUser>(), ISysUserServic
 
             // 密码搞一下
             if (!entity.password.isNullOrEmpty() && entity.password!!.length >= 6) {
-                val salt = RandomStringUtils.random(9)!!
+                val salt = RandomStringUtils.randomAlphanumeric(9)!!
                 entity.salt = salt
                 entity.password = MD5Salt.md5SaltEncode(salt, entity.password!!)
             }