src/main/java/io/github/biezhi/wechat/api/WeChatApiImpl.java
private String checkLogin(String uuid) {
        String uid  = null != uuid ? uuid : this.uuid;
        String url  = String.format("%s/cgi-bin/mmwebwx-bin/login", Constant.BASE_URL);
        Long   time = System.currentTimeMillis();

        ApiResponse response = this.client.send(new StringRequest(url)
                .add("loginicon", true).add("uuid", uid)
                .add("tip", "1").add("_", time)
                .add("r", (int) (-time / 1000) / 1579)
                .timeout(30));

        Matcher matcher = CHECK_LOGIN_PATTERN.matcher(response.getRawBody());
        if (matcher.find()) {
            if (StateCode.SUCCESS.equals(matcher.group(1))) {
                if (!this.processLoginSession(response.getRawBody())) {
                    return StateCode.FAIL;
                }
                return StateCode.SUCCESS;
            }
            return matcher.group(1);
        }
        return StateCode.FAIL;
    }
private String checkLogin(String uuid) {
        String uid  = null != uuid ? uuid : this.uuid;
        String url  = String.format("%s/cgi-bin/mmwebwx-bin/login", Constant.BASE_URL);
        Long   time = System.currentTimeMillis();

        ApiResponse response = this.client.send(new StringRequest(url)
                .add("loginicon", true).add("uuid", uid)
                .add("tip", "1").add("_", time)
                .add("r", (int) (-time / 1000) / 1579)
                .timeout(30));

        Matcher matcher = CHECK_LOGIN_PATTERN.matcher(response.getRawBody());
        if (matcher.find()) {
            if (StateCode.SUCCESS.equals(matcher.group(1))) {
                if (!this.processLoginSession(response.getRawBody())) {
                    return StateCode.FAIL;
                }
                return StateCode.SUCCESS;
            }
            return matcher.group(1);
        }
        return StateCode.FAIL;
    }
private String checkLogin ( String uuid ) { String uid = null != uuid ? uuid : this . uuid ; String url = String . format ( "%s/cgi-bin/mmwebwx-bin/login" , Constant . BASE_URL ) ; Long time = System . currentTimeMillis ( ) ; ApiResponse response = this . client . send ( new StringRequest ( url ) . add ( "loginicon" , true ) . add ( "uuid" , uid ) . add ( "tip" , "1" ) . add ( "_" , time ) . add ( "r" , ( int ) ( - time / 1000 ) / 1579 ) . timeout ( 30 ) ) ; Matcher matcher = CHECK_LOGIN_PATTERN . matcher ( response . getRawBody ( ) ) ; if ( matcher . find ( ) ) { if ( StateCode . SUCCESS . equals ( matcher . group ( 1 ) ) ) { if ( ! this . processLoginSession ( response . getRawBody ( ) ) ) { return StateCode . FAIL ; } return StateCode . SUCCESS ; } return matcher . group ( 1 ) ; } return StateCode . FAIL ; }
检查是否登录

@param uuid 二维码uuid
@return 返回登录状态码
检查是否登录