KOCA版本 :3.4
KOCA模块 :登录
模块版本 :3.4
场景 :重写LoginService自定义登录,但是调用不到
问题 :

报错细节 :
尝试解决方案:
看看spring容器里有没有这个对象,还有就是要用Webflux么,见到的大多数是 extends MutiLoginAuthenticationProvider
@Bean 一般要放到 @Configuration 的类里
已经解决了,是@bean的问题,没注入进去,放到@configuration里好了
已经解决了,是@bean的问题,没注入进去,放到@configuration理好了
1
public static String request(String postUrl, String jsonbody,String method) throws Exception {
URL url = new URL(postUrl);
HttpURLConnection httpConn = null;
if(postUrl.startsWith(“https://”)){
httpConn=(HttpsURLConnection) url.openConnection();
}else{
httpConn=(HttpURLConnection) url.openConnection();
}
httpConn.setDoOutput(true);
httpConn.setDoInput(true);
httpConn.setUseCaches(false);
httpConn.setRequestMethod(method);
httpConn.setRequestProperty(“Content-Type”, “application/json;charset=utf-8”);
httpConn.setRequestProperty(“Connection”, “Keep-Alive”);
httpConn.connect();
DataOutputStream dos = new DataOutputStream(httpConn.getOutputStream());
dos.write(jsonbody.getBytes(“UTF-8”));
dos.flush();
dos.close();
int resultCode = httpConn.getResponseCode();
if (HttpURLConnection.HTTP_OK == resultCode) {
StringBuffer sb = new StringBuffer();
String readLine = new String();
BufferedReader responseReader = new BufferedReader(
new InputStreamReader(httpConn.getInputStream(), “UTF-8”));
while ((readLine = responseReader.readLine()) != null) {
sb.append(readLine).append("\n");
}
responseReader.close();
return sb.toString();
}
return null;
}