Code Duplication    Length = 14-14 lines in 2 locations

src/API/AuthApi.php 2 locations

@@ 64-77 (lines=14) @@
61
     *
62
     * @return array
63
     */
64
    public function getUser($openId, $accessToken)
65
    {
66
        $queryStr = [
67
            'access_token' => $accessToken,
68
            'openid'       => $openId,
69
            'lang'         => 'zh_CN',
70
        ];
71
72
        $this->apitype = 'sns';
73
        $this->module  = 'userinfo';
74
        $res           = $this->_get('', $queryStr);
75
76
        return $res;
77
    }
78
79
    /**
80
     * 获取已授权用户
@@ 127-140 (lines=14) @@
124
     *
125
     * @return boolean
126
     */
127
    public function accessTokenIsValid($accessToken, $openId)
128
    {
129
        $params = [
130
            'openid'       => $openId,
131
            'access_token' => $accessToken,
132
        ];
133
134
        $this->apitype = 'sns';
135
        $this->module  = 'auth';
136
137
        $res = $this->_get('', $params);
138
139
        return $res;
140
    }
141
142
    /**
143
     * 刷新 access_token