Skip to content

Commit

Permalink
fix: 修复回复评论用户显示错误问题
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyueyi committed Feb 10, 2023
1 parent 99ce166 commit adc9cd4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@
class="comment-item-wrap-second"
>
<div class="comment-item-top">
<a th:href="${'/user/' + comment.userId}" target="_blank">
<img th:src="${comment.userPhoto}" class="comment-item-img" />
<a th:href="${'/user/' + reply.userId}" target="_blank">
<img th:src="${reply.userPhoto}" class="comment-item-img" />
</a>
<div class="common-item-content">
<div class="common-item-content-head">
<span>
<a
th:text="${comment.userName} + ${comment.userId == article.author ? '(作者)': ''}"
th:text="${reply.userName} + ${reply.userId == article.author ? '(作者)': ''}"
th:href="${'/user/' + reply.userId}"
target="_blank"
class="comment-name"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.github.paicoding.forum.test.pwd;

import org.junit.Test;
import org.springframework.util.DigestUtils;

import java.nio.charset.StandardCharsets;

/**
* @author YiHui
* @date 2023/2/10
*/
public class PwdGenTest {

@Test
public void testGen() {
String salt = "tech_π";
int saltIndex = 3;
String plainPwd = "123456";
if (plainPwd.length() > saltIndex) {
plainPwd = plainPwd.substring(0, saltIndex) + salt + plainPwd.substring(saltIndex);
} else {
plainPwd = plainPwd + salt;
}
System.out.println(DigestUtils.md5DigestAsHex(plainPwd.getBytes(StandardCharsets.UTF_8)));

}
}

0 comments on commit adc9cd4

Please sign in to comment.