|
@@ -22,7 +22,6 @@ import com.fdkankan.ucenter.vo.request.LoginParam;
|
|
import com.fdkankan.ucenter.vo.request.RegisterParam;
|
|
import com.fdkankan.ucenter.vo.request.RegisterParam;
|
|
import com.fdkankan.ucenter.vo.response.LoginVo;
|
|
import com.fdkankan.ucenter.vo.response.LoginVo;
|
|
import com.fdkankan.ucenter.vo.response.UserVo;
|
|
import com.fdkankan.ucenter.vo.response.UserVo;
|
|
-import io.jsonwebtoken.Claims;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -53,7 +52,12 @@ public class LoginService {
|
|
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 password = Base64Converter.decode(Base64Converter.subText(param.getPassword()));
|
|
|
|
|
|
+ String password ;
|
|
|
|
+ if(StringUtils.isNotBlank(param.getClear()) && param.getClear().equals("YES")){
|
|
|
|
+ password = param.getPassword();
|
|
|
|
+ }else {
|
|
|
|
+ password = Base64Converter.decode(Base64Converter.subText(param.getPassword()));
|
|
|
|
+ }
|
|
String passwordCode = SecurityUtil.MD5(password);
|
|
String passwordCode = SecurityUtil.MD5(password);
|
|
User user = userService.getByUserName(param.getPhoneNum());
|
|
User user = userService.getByUserName(param.getPhoneNum());
|
|
if(user == null){
|
|
if(user == null){
|
|
@@ -269,4 +273,9 @@ public class LoginService {
|
|
redisUtil.del(RedisKeyUtil.PREFIX_MSG_AUTH_CODE + userName);
|
|
redisUtil.del(RedisKeyUtil.PREFIX_MSG_AUTH_CODE + userName);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public LoginVo loginClear(LoginParam param) {
|
|
|
|
+ param.setClear("YES"); //明文登录
|
|
|
|
+ return login(param);
|
|
|
|
+ }
|
|
}
|
|
}
|