|
|
|
@ -76,7 +76,7 @@ public class SingleLoginController {
|
|
|
|
|
@GetMapping("/login")
|
|
|
|
|
public void login(HttpServletResponse response) throws IOException {
|
|
|
|
|
//变成参数模式,appid 用于校验提交的来源地址,生产环境会校验,试用环境暂不校验
|
|
|
|
|
String scUrl = "clientUrl=" + URLEncoder.encode(returnUrl, "UTF-8") + "?appid=b40b40e3-f188-4e00-b67a6ec5701ce02b";
|
|
|
|
|
String scUrl = "clientUrl=" + URLEncoder.encode(returnUrl, "UTF-8") + "?appid=b40b40e3-f188-4e00-b67a-6ec5701ce02b";
|
|
|
|
|
//加密后的客户端地址
|
|
|
|
|
scUrl = Base64.getEncoder().encodeToString(scUrl.getBytes());
|
|
|
|
|
//最终跳转地址
|
|
|
|
@ -116,18 +116,13 @@ public class SingleLoginController {
|
|
|
|
|
JSONObject mainobj = dataObj.getJSONObject("mainbody");
|
|
|
|
|
UserResponse res = JSONUtil.toBean(dataObj, UserResponse.class);
|
|
|
|
|
UserMainResponse req = JSONUtil.toBean(mainobj, UserMainResponse.class);
|
|
|
|
|
//存储到企业信息库
|
|
|
|
|
//如果在企业库里面找不到该企业就返回错误
|
|
|
|
|
QueryWrapper<BmsEnterpriseBasicInfo> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
queryWrapper.eq("credit_code", req.getUscc());
|
|
|
|
|
queryWrapper.eq("tyshxydm", req.getUscc());
|
|
|
|
|
BmsEnterpriseBasicInfo bmsEnterpriseBasicInfo = bmsEnterpriseBasicInfoMapper.selectOne(queryWrapper);
|
|
|
|
|
BmsEnterpriseBasicInfo bms = new BmsEnterpriseBasicInfo();
|
|
|
|
|
Long id;
|
|
|
|
|
if (bmsEnterpriseBasicInfo == null) {
|
|
|
|
|
bms.setCreditCode(req.getUscc());
|
|
|
|
|
bms.setEnterpriseName(req.getEpname());
|
|
|
|
|
bms.setIsDeleted(0L);
|
|
|
|
|
bmsEnterpriseBasicInfoMapper.insert(bms);
|
|
|
|
|
id = bms.getId();
|
|
|
|
|
throw new ServiceException("该企业不在库!请稍后再试!");
|
|
|
|
|
}else {
|
|
|
|
|
id = bmsEnterpriseBasicInfo.getId();
|
|
|
|
|
}
|
|
|
|
|