1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

创建新的小程序,进出码,体温上报功能迁移基本完成

This commit is contained in:
2023-03-17 04:55:02 +08:00
parent 5b98be9bf9
commit b7bf3bfc15
88 changed files with 4337 additions and 276 deletions

View File

@@ -82,6 +82,12 @@
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<!-- 密码 Hash 加密 -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<!-- 热部署 -->
<!--<dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->

View File

@@ -4,6 +4,7 @@ import com.cxyxiaomo.epp.common.pojo.User;
import com.cxyxiaomo.epp.common.response.Res;
import com.cxyxiaomo.epp.common.vo.UserVO;
import com.cxyxiaomo.epp.user.service.UserServiceImpl;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
@@ -32,8 +33,8 @@ public class UserController {
public Res login(@RequestParam("username") String username, @RequestParam("password") String password) {
User user = userService.getUserByUsername(username);
if (user != null) {
String passwordHash = user.getPassword();
if (passwordHash.equals(password)) {
String passwordHash = DigestUtils.sha512Hex(password);
if (passwordHash.equals(user.getPassword())) {
HashMap<String, Object> map = new HashMap<>();
map.put("userInfo", UserVO.convertFrom(user));
return Res.success(map);