Commit d19b200452709553baaa055205c02b71100875a4
1 parent
b8cc5fad88
Exists in
master
小程序登录密码加密处理
Showing 2 changed files with 12 additions and 0 deletions
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java
View file @
d19b200
... | ... | @@ -17,6 +17,7 @@ |
17 | 17 | import com.lyms.talkonlineweb.util.*; |
18 | 18 | import lombok.extern.log4j.Log4j2; |
19 | 19 | import org.springframework.beans.factory.annotation.Autowired; |
20 | +import org.springframework.util.DigestUtils; | |
20 | 21 | import org.springframework.util.StringUtils; |
21 | 22 | import org.springframework.validation.BindingResult; |
22 | 23 | import org.springframework.validation.annotation.Validated; |
... | ... | @@ -295,6 +296,12 @@ |
295 | 296 | @PostMapping("loginPatient") |
296 | 297 | public BaseResponse loginPatient(@RequestBody LymsPatient patient) { |
297 | 298 | BaseResponse baseResponse = new BaseResponse(); |
299 | + | |
300 | + //公众号跳转小程序登录状态。loginType==1不需要加密处理,这里是反相判断 | |
301 | + if(!patient.getLoginType().equals(1)){ | |
302 | + //密码加密 | |
303 | + patient.setPpasswd(DigestUtils.md5DigestAsHex(patient.getPpasswd().getBytes())); | |
304 | + } | |
298 | 305 | List<LymsPatient> dLst = lymsPatientService.list(Wrappers.query(patient)); |
299 | 306 | baseResponse.setErrorcode(1); |
300 | 307 | LymsPatient patient2=null; |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/domain/LymsPatient.java
View file @
d19b200
... | ... | @@ -117,6 +117,11 @@ |
117 | 117 | */ |
118 | 118 | @TableField(exist = false) |
119 | 119 | private Integer type; |
120 | + /** | |
121 | + * 公众号跳转小程序登录状态。1不需要加密处理 | |
122 | + */ | |
123 | + @TableField(exist = false) | |
124 | + private Integer loginType; | |
120 | 125 | |
121 | 126 | @TableField(exist = false) |
122 | 127 | private static final long serialVersionUID = 1L; |