中文乱码错误
This commit is contained in:
parent
2be6c852ef
commit
f9306c82d5
@ -107,7 +107,7 @@ public class Aes {
|
||||
cipher.init(Cipher.DECRYPT_MODE, skey);
|
||||
byte[] result = cipher.doFinal(new Base64().decode(content));
|
||||
// 解密
|
||||
return new String(result);
|
||||
return new String(result, "UTF-8");
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
@ -115,9 +115,9 @@ public class Aes {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String content = "RaxMRsBUfFDjz_U_7LB_TJHqPNDVlpiOtkdqhZMTDoW3bHbfHnQ8_wuKIcVJemVn".replace("-", "+").replace("_", "/");
|
||||
String content = "grWn9TcbYmxu0KjA5utvyX38gGTPleC86M5PM8CuFmnqBaSNY0UV2xjn4EyijUZdkQtOPmES+ElFMTEXaiWo0Q==";
|
||||
// System.out.println("RaxMRsBUfFDjz/U/7LB/TBRIDE/1I6ZZ9kmQFWqgLCID42evqzeC8kpDSd3GM7YB".replace("+", "-").replace("/", "_"));
|
||||
// System.out.println(encrypt("{\"uid\":\"test\",\"exp\":1686559180478}", "ssologin66!@#$%^"));
|
||||
System.out.println(decrypt(content, "ssologin66!@#$%^"));
|
||||
System.out.println(decrypt(content, KEY));
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user