rk
昨天 38d111cb6defedff3bf06314ca30d22a01faae22
server/services/src/main/java/com/doumee/core/iPass/IPass.java
@@ -27,7 +27,7 @@
    private static String tokenUrl = "https://ipaasuat.zhibang.com:4430/open-api/rest/core/auth/login";
    private static String zhanquUrl = "https://ipaasuat.zhibang.com:4430/open-api/mdm/cust-territories-trees/query";
    public String getIPassToken() throws IOException {
    public String getIPassToken(String userName,String password,String tokenUrl) throws IOException {
        OkHttpClient client = new OkHttpClient().newBuilder()
                .build();
        MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
@@ -55,7 +55,7 @@
    public List<ZhanQuVO> getIPassZhanquList() throws IOException {
    public List<ZhanQuVO> getIPassZhanquList(String userName,String password,String tokenUrl,String zhanquUrl) throws IOException {
        OkHttpClient client = new OkHttpClient().newBuilder()
                .build();
        MediaType mediaType = MediaType.parse("application/json");
@@ -68,7 +68,7 @@
        Request request = new Request.Builder()
                .url(zhanquUrl)
                .method("POST", body)
                .addHeader("identitytoken", getIPassToken())
                .addHeader("identitytoken", getIPassToken(userName,password,tokenUrl))
                .addHeader("User-Agent", "Apifox/1.0.0 (https://apifox.com)")
                .addHeader("Content-Type", "application/json")
                .build();
@@ -86,11 +86,6 @@
    }
    public static void main(String[] args) throws IOException {
        IPass iPass = new IPass();
        iPass.getIPassZhanquList();
    }
}