parent
3428d8830e
commit
29ba11eb88
@ -28,6 +28,8 @@ import com.fasterxml.jackson.databind.JsonNode;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -125,13 +127,13 @@ public class SecurityProxy {
|
||||
* @param server server address
|
||||
* @return true if login successfully
|
||||
*/
|
||||
public boolean login(String server) {
|
||||
public boolean login(String server) throws UnsupportedEncodingException {
|
||||
|
||||
if (StringUtils.isNotBlank(username)) {
|
||||
Map<String, String> params = new HashMap<String, String>(2);
|
||||
Map<String, String> bodyMap = new HashMap<String, String>(2);
|
||||
params.put("username", username);
|
||||
bodyMap.put("password", password);
|
||||
bodyMap.put("password", URLEncoder.encode(password, "utf-8"));
|
||||
String url = "http://" + server + contextPath + LOGIN_URL;
|
||||
|
||||
if (server.contains(Constants.HTTP_PREFIX)) {
|
||||
|
Loading…
Reference in New Issue
Block a user