|
@@ -7,10 +7,12 @@ import com.platform.yijia.pojo.*;
|
|
|
import com.platform.yijia.service.*;
|
|
|
import com.platform.yijia.utils.CodeMsg;
|
|
|
import com.platform.yijia.utils.CryptUtil;
|
|
|
+import com.platform.yijia.utils.DESUtils;
|
|
|
import com.platform.yijia.utils.ResultData;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.ibatis.annotations.Param;
|
|
|
import org.omg.CORBA.ObjectHelper;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -48,6 +50,9 @@ public class PosMachineController {
|
|
|
@Resource
|
|
|
private PayOrderService payOrderService;
|
|
|
|
|
|
+ @Value("${3des.pwd}")
|
|
|
+ private String pwd;
|
|
|
+
|
|
|
//POS机端用户登录
|
|
|
@RequestMapping(value = "/loginPosMachine", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
@@ -63,9 +68,11 @@ public class PosMachineController {
|
|
|
if(sysUser.getStatus().equals("0")){
|
|
|
String password = sysUser.getPassword();
|
|
|
//password = CryptUtil.desedeDecrypt(password);
|
|
|
+ String webPassword = loginBody.getPassword(); //前端传来加密码
|
|
|
+ String ps= DESUtils.decrypt(webPassword, pwd);
|
|
|
BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
|
|
|
//密码加密判断已加密密码是否与真实密码相同
|
|
|
- boolean matches = bCryptPasswordEncoder.matches(loginBody.getPassword(), password);
|
|
|
+ boolean matches = bCryptPasswordEncoder.matches(ps, password);
|
|
|
if(matches){
|
|
|
SysUser s = new SysUser();
|
|
|
s.setNickName(sysUser.getNickName());
|