1
0
mirror of synced 2026-05-22 21:53:18 +00:00

♻️ 添加 Request 的 AuthStateCache 构造器

This commit is contained in:
Yangkai.Shen
2019-08-02 14:57:13 +08:00
parent c1f9e96a92
commit 3e8c475d3f
25 changed files with 162 additions and 19 deletions
@@ -5,12 +5,16 @@ import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import me.zhyd.oauth.cache.AuthStateCache;
import me.zhyd.oauth.config.AuthConfig;
import me.zhyd.oauth.config.AuthSource;
import me.zhyd.oauth.enums.AuthResponseStatus;
import me.zhyd.oauth.enums.AuthUserGender;
import me.zhyd.oauth.exception.AuthException;
import me.zhyd.oauth.model.*;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.model.AuthResponse;
import me.zhyd.oauth.model.AuthToken;
import me.zhyd.oauth.model.AuthUser;
import me.zhyd.oauth.utils.UrlBuilder;
import java.text.MessageFormat;
@@ -29,6 +33,10 @@ public class AuthMiRequest extends AuthDefaultRequest {
super(config, AuthSource.MI);
}
public AuthMiRequest(AuthConfig config, AuthStateCache authStateCache) {
super(config, AuthSource.MI, authStateCache);
}
@Override
protected AuthToken getAccessToken(AuthCallback authCallback) {
return getToken(accessTokenUrl(authCallback.getCode()));