i皖送接入公司框架优化

This commit is contained in:
15856 2025-01-23 17:54:48 +08:00
parent aeee748cd9
commit 674d8cce2d
2 changed files with 14 additions and 9 deletions

View File

@ -170,7 +170,10 @@ public class TokenController {
if (StringUtils.isNotEmpty(ticket)) {
LoginUser loginUser = new LoginUser();
if (form.getSysType()!=null && "1".equals(form.getSysType())){
loginUser = sysLoginService.iwsH5Login(ticket,iwsH5AppId,iwsH5Url);
log.info("app端登录");
//loginUser = sysLoginService.iwsH5Login(ticket,iwsH5AppId,iwsH5Url);
//h5和web端调用同一个接口
loginUser = sysLoginService.iwsWebLogin(ticket,iwsH5AppId,iwsWebUrl);
} else if (form.getSysType()!=null && "0".equals(form.getSysType())) {
loginUser = sysLoginService.iwsWebLogin(ticket,iwsWebAppId,iwsWebUrl);
}else {

View File

@ -249,7 +249,7 @@ public class SysLoginService {
registerBody.setUsername(sysUser.getUserName());
registerBody.setNickName(sysUser.getNickName());
registerBody.setMobile(sysUser.getPhonenumber());
registerBody.setDeptId(220L);
registerBody.setDeptId(1L);
registerBody.setPassword("Bonus@Max2024");
//获取配置中的初始密码
AjaxResult result = configService.getConfigKey("sys.user.initPassword");
@ -299,13 +299,15 @@ public class SysLoginService {
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> authResponse = restTemplate.getForEntity(iwsH5Url, String.class, paramMap);
log.info("authResponse:" + authResponse.toString());
if ("200".equals(authResponse.getStatusCode())){
// 根据ResponseEntity<String> responseEntity对象获取body部分body为json格式字符串
String content = authResponse.getBody();
// 将json字符串转化为json对象
JSONObject json = JSONObject.parseObject(content);
// 取出data部分对象
JSONObject data = json.getJSONObject("data");
// 根据ResponseEntity<String> responseEntity对象获取body部分body为json格式字符串
String content = authResponse.getBody();
// 将json字符串转化为json对象
JSONObject json = JSONObject.parseObject(content);
// 取出data部分对象
JSONObject data = json.getJSONObject("data");
log.info("返回的数据:" + data);
if ("200".equals(json.getInteger("code").toString())){
JSONObject userInfo = data.getJSONObject("userInfo");
sysUser.setUserName(userInfo.get("userName").toString());
sysUser.setNickName(userInfo.get("name").toString());