更新后台端口

This commit is contained in:
liuchengqian 2022-07-06 10:44:40 +08:00
parent c3ecdee6d7
commit 1171c4332a
2 changed files with 21 additions and 11 deletions

View File

@ -5,39 +5,50 @@ import java.security.NoSuchAlgorithmException;
/**
* SHA加密解密工具
*
* @author tajochen
*/
public class EncryptDecryptUtil {
public static void main(String[] args) {
String password = "zzpassword";
String salt = "2b1d8a197c24eb36";
String encrypt = encry256(password + salt);
System.out.println("encrypt = " + encrypt);
}
/**
* SHA-256加密
*
* @param strText
* @return
*/
public static String encry256(final String strText){
return encrySha(strText,"SHA-256");
public static String encry256(final String strText) {
return encrySha(strText, "SHA-256");
}
/**
* SHA-512加密
*
* @param strText
* @return
*/
public static String encry512(final String strText){
return encrySha(strText,"SHA-512");
public static String encry512(final String strText) {
return encrySha(strText, "SHA-512");
}
/**
* 基础SHA加密
*
* @param strText
* @param strType
* @return
*/
private static String encrySha(final String strText, final String strType){
private static String encrySha(final String strText, final String strType) {
// 返回值
String strResult=null;
String strResult = null;
// 是否是有效的字符串
if (strText != null && strText.length()>0){
if (strText != null && strText.length() > 0) {
// 加密开始创建加密对象并传入加密类型
try {
MessageDigest messageDigest = MessageDigest.getInstance(strType);
@ -55,8 +66,7 @@ public class EncryptDecryptUtil {
}
// 得到返回的结果
strResult = strHexString.toString();
}
catch (NoSuchAlgorithmException e) {
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
}

View File

@ -1,4 +1,4 @@
server.port = 6801
server.port = 6101
## 数据源配置
spring.datasource.url = jdbc:postgresql://118.24.27.47:5432/fire_point