创建新的小程序,进出码,体温上报功能迁移基本完成
This commit is contained in:
@@ -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>-->
|
||||
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user