1
0
mirror of synced 2026-04-27 03:58:41 +08:00

🔖 Release version 1.16.0

This commit is contained in:
yadong.zhang
2021-03-13 23:15:22 +08:00
parent 3e890f2c2a
commit cd324cc7c1
8 changed files with 29 additions and 21 deletions

View File

@@ -4,30 +4,31 @@ import me.zhyd.oauth.log.Log;
/**
* JustAuth 日志配置类
*
* @author HeJin
* @date 2021/1/9 20:28
*/
public class JustAuthLogConfig {
/**
* 设置日志级别
*
* @param level 日志级别
*/
public static void setLevel(Log.Level level){
public static void setLevel(Log.Level level) {
Log.Config.level = level;
}
/**
* 关闭日志
*/
public static void disable(){
public static void disable() {
Log.Config.enable = false;
}
/**
* 开启日志
*/
public static void enable(){
public static void enable() {
Log.Config.enable = true;
}
}

View File

@@ -28,9 +28,10 @@ public enum AuthResponseStatus {
ILLEGAL_CODE(5008, "Illegal code"),
ILLEGAL_STATUS(5009, "Illegal state"),
REQUIRED_REFRESH_TOKEN(5010, "The refresh token is required; it must not be null"),
ILLEGAL_TOKEN(5011, "Invalid token"),
;
private int code;
private String msg;
private final int code;
private final String msg;
}

View File

@@ -8,7 +8,6 @@ import me.zhyd.oauth.enums.AuthUserGender;
import me.zhyd.oauth.model.AuthCallback;
import me.zhyd.oauth.model.AuthToken;
import me.zhyd.oauth.model.AuthUser;
import me.zhyd.oauth.utils.UrlBuilder;
/**
* 阿里云登录
@@ -31,12 +30,12 @@ public class AuthAliyunRequest extends AuthDefaultRequest {
String response = doPostAuthorizationCode(authCallback.getCode());
JSONObject accessTokenObject = JSONObject.parseObject(response);
return AuthToken.builder()
.accessToken(accessTokenObject.getString("access_token"))
.expireIn(accessTokenObject.getIntValue("expires_in"))
.tokenType(accessTokenObject.getString("token_type"))
.idToken(accessTokenObject.getString("id_token"))
.refreshToken(accessTokenObject.getString("refresh_token"))
.build();
.accessToken(accessTokenObject.getString("access_token"))
.expireIn(accessTokenObject.getIntValue("expires_in"))
.tokenType(accessTokenObject.getString("token_type"))
.idToken(accessTokenObject.getString("id_token"))
.refreshToken(accessTokenObject.getString("refresh_token"))
.build();
}
@Override