更新后台端口

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加密解密工具 * SHA加密解密工具
*
* @author tajochen * @author tajochen
*/ */
public class EncryptDecryptUtil { 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加密 * SHA-256加密
*
* @param strText * @param strText
* @return * @return
*/ */
public static String encry256(final String strText){ public static String encry256(final String strText) {
return encrySha(strText,"SHA-256"); return encrySha(strText, "SHA-256");
} }
/** /**
* SHA-512加密 * SHA-512加密
*
* @param strText * @param strText
* @return * @return
*/ */
public static String encry512(final String strText){ public static String encry512(final String strText) {
return encrySha(strText,"SHA-512"); return encrySha(strText, "SHA-512");
} }
/** /**
* 基础SHA加密 * 基础SHA加密
*
* @param strText * @param strText
* @param strType * @param strType
* @return * @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 { try {
MessageDigest messageDigest = MessageDigest.getInstance(strType); MessageDigest messageDigest = MessageDigest.getInstance(strType);
@ -55,12 +66,11 @@ public class EncryptDecryptUtil {
} }
// 得到返回的结果 // 得到返回的结果
strResult = strHexString.toString(); strResult = strHexString.toString();
} } catch (NoSuchAlgorithmException e) {
catch (NoSuchAlgorithmException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
return strResult; return strResult;
} }
} }

View File

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