Closed huanglingz closed 2 years ago
发现 #265 已解决这个问题。 猜测,你yml配置可能没配。具体是secret和iv需要配一下。 个人觉得,如果数位不够没关系,反正它自动生成正确的:)
login-captcha: enabled: false secret: "Ds0G43os5QiOHKgDpcUhxIU0YdgsO8JD" iv: "wJYbmnQqtj8dwaKR"
确实是没有iv这个配置,拉下来就是没有这个配置,debug发现了这个空指针的问题。
Using 'application/json', given [/] and supported [application/json, application/+json, application/json, application/+json] Writing [UnifyResponseVO(code=9999, message=服务器未知错误, request=POST /cms/user/captcha)] Resolved [java.lang.NullPointerException]
问题定位到这里 public static String aesEncode(String secret, String iv, String content) throws GeneralSecurityException { SecretKey secretKey = new SecretKeySpec(secret.getBytes(), AES); Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); cipher.init(Cipher.ENCRYPT_MODE, secretKey, new IvParameterSpec(iv.getBytes(StandardCharsets.US_ASCII))); 这里异常