导入工号

This commit is contained in:
baozhipeng
2022-04-11 15:36:43 +08:00
parent 5fb04e6b0b
commit da385bd445
@@ -90,7 +90,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
private String defaultPassword;
@Value("${singleSignON.client_id}")
private String client_id;
@Value("${singleSignON.client_id}")
@Value("${singleSignON.client_secret}")
private String client_secret;
@Override
@@ -647,7 +647,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
HashMap<String, Object> tokenParam = new HashMap<>();
tokenParam.put("client_id", client_id);
tokenParam.put("client_secret", client_secret);
tokenParam.put("code", 1);
tokenParam.put("code", code);
tokenParam.put("grant_type", "authorization_code");
String tokenRes= HttpUtil.post("https://idmtest.catarc.ac.cn/bam-protocol-service/oauth2/getToken", tokenParam);
@@ -660,9 +660,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
userInfoParam.put("client_id", client_id);
String userInfoRes= HttpUtil.get("https://idmtest.catarc.ac.cn/bam-protocol-service/oauth2/getUserInfo", userInfoParam);
JSONObject userInfoJson = JSONObject.parseObject(userInfoRes);
String loginName = userInfoJson.getString("loginName");
//根据工号登录
return loginByUserNo("01433");
return loginByUserNo(loginName);
}
/**