whychdw
2020-04-27 80c9b1ec4ab5caa4e477fe95abcb70b1c9cbe50b
修改后台
3个文件已修改
20 ■■■■■ 已修改文件
webSockTest/src/com/fgkj/actions/FaceIdentify.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
webSockTest/src/com/fgkj/services/FaceDetect.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
webSockTest/src/com/fgkj/services/HttpUtil.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
webSockTest/src/com/fgkj/actions/FaceIdentify.java
@@ -12,7 +12,7 @@
     *     获取refresh_token 值
     * @return
     */
    public String getAuth(){
    public String Auth(){
        String json = AuthService.getAuth();
        result = getGson().toJson(json);
        return SUCCESS;
@@ -23,8 +23,9 @@
     * @return
     */
    public String faceDetect(){
        String result = FaceDetect.faceDetect(json);
        result = getGson().toJson(result);
        String str = FaceDetect.faceDetect(json);
        result = null;
        result = getGson().toJson(str);
        return SUCCESS;
    }
    
webSockTest/src/com/fgkj/services/FaceDetect.java
@@ -34,9 +34,9 @@
            // 注意这里仅为了简化编码每一次请求都去获取access_token,线上环境access_token有过期时间, 客户端可自行缓存,过期后重新获取。
            //String accessToken = "[调用鉴权接口获取的token]";
            String result = HttpUtil.post(url, map.get("accessToken").toString(), "application/json", param);
            System.out.println(result);
            return result;
            String msg = HttpUtil.post(url, map.get("accessToken").toString(), "application/json", param);
            return msg;
        } catch (Exception e) {
            e.printStackTrace();
        }
webSockTest/src/com/fgkj/services/HttpUtil.java
@@ -58,9 +58,9 @@
        // 获取所有响应头字段
        Map<String, List<String>> headers = connection.getHeaderFields();
        // 遍历所有的响应头字段
        for (String key : headers.keySet()) {
            System.err.println(key + "--->" + headers.get(key));
        }
//        for (String key : headers.keySet()) {
//            System.err.println(key + "--->" + headers.get(key));
//        }
        // 定义 BufferedReader输入流来读取URL的响应
        BufferedReader in = null;
        in = new BufferedReader(
@@ -70,6 +70,7 @@
        while ((getLine = in.readLine()) != null) {
            result += getLine;
        }
        //System.out.println("&&&&&&&&&&&&&&&&&&&&&"+result);
        in.close();
        return result;
    }