Compare commits
3 Commits
e2cfe69b4c
...
3d57ce1260
| Author | SHA1 | Date |
|---|---|---|
|
|
3d57ce1260 | |
|
|
7d4f5bf2bc | |
|
|
0daa17af13 |
|
|
@ -47,7 +47,7 @@ public class PartApplyAppServiceImp {
|
|||
public ServerResponse getDevList(MachinesVo dto) {
|
||||
try{
|
||||
List<MachinesVo> list=mapper.getDevList(dto);
|
||||
ServerResponse.createSuccess(list);
|
||||
return ServerResponse.createSuccess(list);
|
||||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ public class JwtAuthenticationTokenFilter extends OncePerRequestFilter {
|
|||
String jwtToken = SecurityUtils.getToken(request);
|
||||
String uri=request.getRequestURI();
|
||||
System.err.println(uri);
|
||||
|
||||
if("/login/userLogin".equals(uri)){
|
||||
filterChain.doFilter(request, response);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ public class Md5Utils {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static boolean validatePassword2(String input, String storedHash) {
|
||||
try {
|
||||
|
||||
|
|
@ -42,9 +44,9 @@ public class Md5Utils {
|
|||
}
|
||||
public static void main(String[] args) throws NoSuchAlgorithmException {
|
||||
// 生成密码散列
|
||||
String password = "123456";
|
||||
String password = "1";
|
||||
String hashedPassword = generateMD5(password);
|
||||
|
||||
System.out.println("Password is valid: " + hashedPassword);
|
||||
// 验证密码
|
||||
boolean isValid = validatePassword(password, hashedPassword);
|
||||
System.out.println("Password is valid: " + isValid);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,68 @@
|
|||
package com.bonus.gzgqj.manager.security.jwt;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
public class md5 {
|
||||
|
||||
|
||||
|
||||
// public static String getMD5(String str) {
|
||||
// try {
|
||||
// // 生成一个MD5加密计算摘要
|
||||
// MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
// // 计算md5函数
|
||||
// md.update(str.getBytes());
|
||||
// // digest()最后确定返回md5 hash值,返回值为8为字符串。因为md5 hash值是16位的hex值,实际上就是8位的字符
|
||||
// // BigInteger函数则将8位的字符串转换成16位hex值,用字符串来表示;得到字符串形式的hash值
|
||||
// return new BigInteger(1, md.digest()).toString(16);
|
||||
// } catch (Exception e) {
|
||||
// System.out.println("MD5加密出现错误");
|
||||
// }
|
||||
// return str;
|
||||
// }
|
||||
|
||||
public static void main(String[] args) {
|
||||
String pwd="Abc@123++";
|
||||
//MD5加盐算法:
|
||||
System.out.println(getMD5WithSalt(pwd));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* MD5加密工具类
|
||||
*/
|
||||
|
||||
/**
|
||||
* 获取MD5字符串
|
||||
*/
|
||||
public static String getMD5(String content) {
|
||||
try {
|
||||
MessageDigest digest = MessageDigest.getInstance("MD5");
|
||||
digest.update(content.getBytes());
|
||||
return getHashString(digest);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static final String SALT = "946a175ccf87b28219f2ccbed6622dab";
|
||||
|
||||
/**
|
||||
* 获取加盐的MD5字符串
|
||||
*/
|
||||
public static String getMD5WithSalt(String content) {
|
||||
return getMD5(getMD5(content+SALT));
|
||||
}
|
||||
|
||||
private static String getHashString(MessageDigest digest) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (byte b : digest.digest()) {
|
||||
builder.append(Integer.toHexString((b >> 4) & 0xf));
|
||||
builder.append(Integer.toHexString(b & 0xf));
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
left join mm_type mt2 on mt.PARENT_ID=mt2.id
|
||||
left join mm_type mt3 on mt2.PARENT_ID=mt3.id
|
||||
where mm.BATCH_STATUS=7
|
||||
<where >
|
||||
|
||||
<if test="name!=null and name!=''">
|
||||
and mt2.NAME like concat('%',#{name},'%')
|
||||
</if>
|
||||
|
|
@ -38,7 +38,6 @@
|
|||
<if test="model!=null and model!=''">
|
||||
and mt.NAME like concat('%',#{model},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="getWfRecordList" resultType="com.bonus.gzgqj.business.app.entity.MachinesVo">
|
||||
select wir.sup_id ,wat.AGREEMENT_ID,
|
||||
|
|
|
|||
Loading…
Reference in New Issue