|
@@ -27,7 +27,7 @@ import com.qmth.themis.common.enums.Source;
|
|
import com.qmth.themis.common.exception.BusinessException;
|
|
import com.qmth.themis.common.exception.BusinessException;
|
|
import com.qmth.themis.common.signature.SignatureInfo;
|
|
import com.qmth.themis.common.signature.SignatureInfo;
|
|
import com.qmth.themis.common.signature.SignatureType;
|
|
import com.qmth.themis.common.signature.SignatureType;
|
|
-import com.qmth.themis.common.util.AesUtil;
|
|
|
|
|
|
+import com.qmth.themis.common.util.Base64Util;
|
|
import com.qmth.themis.common.util.Result;
|
|
import com.qmth.themis.common.util.Result;
|
|
import com.qmth.themis.common.util.ResultUtil;
|
|
import com.qmth.themis.common.util.ResultUtil;
|
|
import io.swagger.annotations.*;
|
|
import io.swagger.annotations.*;
|
|
@@ -39,6 +39,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
import java.security.NoSuchAlgorithmException;
|
|
import java.security.NoSuchAlgorithmException;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
@@ -87,7 +88,7 @@ public class TBUserController {
|
|
@ApiJsonObject(name = "loginAccount", value = {@ApiJsonProperty(key = "loginName", description = "登录名"),
|
|
@ApiJsonObject(name = "loginAccount", value = {@ApiJsonProperty(key = "loginName", description = "登录名"),
|
|
@ApiJsonProperty(key = "password", description = "密码"),
|
|
@ApiJsonProperty(key = "password", description = "密码"),
|
|
@ApiJsonProperty(key = "code", description = "机构代码")}) @ApiParam(value = "用户信息", required = true) @RequestBody Map<String, Object> mapParameter)
|
|
@ApiJsonProperty(key = "code", description = "机构代码")}) @ApiParam(value = "用户信息", required = true) @RequestBody Map<String, Object> mapParameter)
|
|
- throws NoSuchAlgorithmException {
|
|
|
|
|
|
+ throws NoSuchAlgorithmException, UnsupportedEncodingException {
|
|
if (Objects.isNull(mapParameter)) {
|
|
if (Objects.isNull(mapParameter)) {
|
|
throw new BusinessException(ExceptionResultEnum.USER_INFO_IS_NULL);
|
|
throw new BusinessException(ExceptionResultEnum.USER_INFO_IS_NULL);
|
|
}
|
|
}
|
|
@@ -145,15 +146,15 @@ public class TBUserController {
|
|
if (Objects.nonNull(user.getOrgId()) && user.getOrgId().longValue() != tbOrg.getId().longValue()) {
|
|
if (Objects.nonNull(user.getOrgId()) && user.getOrgId().longValue() != tbOrg.getId().longValue()) {
|
|
throw new BusinessException("用户机构不匹配");
|
|
throw new BusinessException("用户机构不匹配");
|
|
}
|
|
}
|
|
- String loginPassword = AesUtil.decryptCs7(password, Constants.AES_RULE);
|
|
|
|
- //密码错误
|
|
|
|
- String aesPassword = AesUtil.decryptCs7(user.getPassword(), Constants.AES_RULE);
|
|
|
|
- if (!Objects.equals(loginPassword, aesPassword)) {
|
|
|
|
|
|
+// String loginPassword = new String(Base64Util.decode(password), Constants.CHARSET_NAME);
|
|
|
|
+// 密码错误
|
|
|
|
+// String base64Password = new String(Base64Util.decode(user.getPassword()), Constants.CHARSET_NAME);
|
|
|
|
+ if (!Objects.equals(password, user.getPassword())) {
|
|
throw new BusinessException(ExceptionResultEnum.PASSWORD_ERROR);
|
|
throw new BusinessException(ExceptionResultEnum.PASSWORD_ERROR);
|
|
}
|
|
}
|
|
return userLoginCommon(user);
|
|
return userLoginCommon(user);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@ApiOperation(value = "短信验证码登陆接口")
|
|
@ApiOperation(value = "短信验证码登陆接口")
|
|
@RequestMapping(value = "/login/verifyCode", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/login/verifyCode", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "用户信息", response = TBUser.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "用户信息", response = TBUser.class)})
|
|
@@ -224,10 +225,10 @@ public class TBUserController {
|
|
mqDtoService.assembleSendOneWayMsg(mqDtoLog);
|
|
mqDtoService.assembleSendOneWayMsg(mqDtoLog);
|
|
//mq发送消息end
|
|
//mq发送消息end
|
|
//测试
|
|
//测试
|
|
- String test = SignatureInfo.build(SignatureType.TOKEN, sessionId, token);
|
|
|
|
|
|
+// String test = SignatureInfo.build(SignatureType.TOKEN, sessionId, token);
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
-// map.put(SystemConstant.ACCESS_TOKEN, token);
|
|
|
|
- map.put(SystemConstant.ACCESS_TOKEN, test);
|
|
|
|
|
|
+ map.put(SystemConstant.ACCESS_TOKEN, token);
|
|
|
|
+// map.put(SystemConstant.ACCESS_TOKEN, test);
|
|
map.put(SystemConstant.ACCOUNT, user);
|
|
map.put(SystemConstant.ACCOUNT, user);
|
|
map.put(SystemConstant.SESSION_ID, sessionId);
|
|
map.put(SystemConstant.SESSION_ID, sessionId);
|
|
map.put("roleCodes", authDto.getRoleCodes());
|
|
map.put("roleCodes", authDto.getRoleCodes());
|