|
@@ -1,5 +1,6 @@
|
|
package com.fdkankan.ucenter.service.impl;
|
|
package com.fdkankan.ucenter.service.impl;
|
|
|
|
|
|
|
|
+import cn.hutool.crypto.digest.MD5;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.fdkankan.common.constant.AppConstant;
|
|
import com.fdkankan.common.constant.AppConstant;
|
|
import com.fdkankan.common.constant.CameraConstant;
|
|
import com.fdkankan.common.constant.CameraConstant;
|
|
@@ -52,7 +53,7 @@ public class AppService {
|
|
if (StringUtils.isEmpty(param.getPassword()) || StringUtils.isEmpty(param.getPhoneNum())){
|
|
if (StringUtils.isEmpty(param.getPassword()) || StringUtils.isEmpty(param.getPhoneNum())){
|
|
throw new BusinessException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
|
|
throw new BusinessException(LoginConstant.FAILURE_CODE_3001, LoginConstant.FAILURE_MSG_3001);
|
|
}
|
|
}
|
|
- String passwordCode = SecurityUtil.MD5(param.getPassword());
|
|
|
|
|
|
+ String passwordCode = MD5.create().digestHex(param.getPassword()).toUpperCase();
|
|
User user = userService.getByUserName(param.getPhoneNum());
|
|
User user = userService.getByUserName(param.getPhoneNum());
|
|
if(user == null){
|
|
if(user == null){
|
|
throw new BusinessException(LoginConstant.FAILURE_CODE_3015, LoginConstant.FAILURE_MSG_3015);
|
|
throw new BusinessException(LoginConstant.FAILURE_CODE_3015, LoginConstant.FAILURE_MSG_3015);
|
|
@@ -62,7 +63,6 @@ public class AppService {
|
|
}
|
|
}
|
|
String token = this.redisLogin(user.getUserName(), JSONObject.toJSONString(user),21800L);
|
|
String token = this.redisLogin(user.getUserName(), JSONObject.toJSONString(user),21800L);
|
|
LoginVo loginVo = commonLogin(user, param, token);
|
|
LoginVo loginVo = commonLogin(user, param, token);
|
|
- loginVo.getUser().setPassword(param.getPassword());
|
|
|
|
return loginVo;
|
|
return loginVo;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -84,7 +84,6 @@ public class AppService {
|
|
BeanUtils.copyProperties(user,userVo);
|
|
BeanUtils.copyProperties(user,userVo);
|
|
userVo.setCameraCount(count);
|
|
userVo.setCameraCount(count);
|
|
userVo.setSceneCount(sceneProCount + scenePlusCount);
|
|
userVo.setSceneCount(sceneProCount + scenePlusCount);
|
|
- userVo.setPassword(SecurityUtil.MD5(user.getPassword()));
|
|
|
|
LoginVo vo = new LoginVo();
|
|
LoginVo vo = new LoginVo();
|
|
vo.setToken(token);
|
|
vo.setToken(token);
|
|
vo.setUser(userVo);
|
|
vo.setUser(userVo);
|