✏️ 修复部分问题,详情见update.md
This commit is contained in:
@@ -63,7 +63,7 @@ public class AuthorizationFactory {
|
||||
AuthorizationFactory.register(AuthSource.OSCHINA, new OschinaAuthorization());
|
||||
AuthorizationFactory.register(AuthSource.QQ, new QqAuthorization());
|
||||
AuthorizationFactory.register(AuthSource.TAOBAO, new TaobaoAuthorization());
|
||||
AuthorizationFactory.register(AuthSource.TENCEN_CLOUD, new TencentCloudAuthorization());
|
||||
AuthorizationFactory.register(AuthSource.TENCENT_CLOUD, new TencentCloudAuthorization());
|
||||
AuthorizationFactory.register(AuthSource.WECHAT, new WeChatAuthorization());
|
||||
AuthorizationFactory.register(AuthSource.WEIBO, new WeiboAuthorization());
|
||||
AuthorizationFactory.register(AuthSource.FACEBOOK, new FacebookAuthorization());
|
||||
|
||||
@@ -16,7 +16,7 @@ public enum AuthSource {
|
||||
CSDN,
|
||||
CODING,
|
||||
OSCHINA,
|
||||
TENCEN_CLOUD,
|
||||
TENCENT_CLOUD,
|
||||
ALIPAY,
|
||||
TAOBAO,
|
||||
QQ,
|
||||
|
||||
@@ -71,7 +71,7 @@ public class AuthAlipayRequest extends BaseAuthRequest {
|
||||
city = response.getCity();
|
||||
return AuthUser.builder()
|
||||
.uuid(response.getUserId())
|
||||
.username(response.getUserName())
|
||||
.username(StringUtils.isEmpty(response.getUserName()) ? response.getNickName() : response.getUserName())
|
||||
.nickname(response.getNickName())
|
||||
.avatar(response.getAvatar())
|
||||
.location(String.format("%s %s", StringUtils.isEmpty(province) ? "" : province, StringUtils.isEmpty(city) ? "" : city))
|
||||
|
||||
@@ -21,7 +21,7 @@ import me.zhyd.oauth.utils.UrlBuilder;
|
||||
public class AuthTencentCloudRequest extends BaseAuthRequest {
|
||||
|
||||
public AuthTencentCloudRequest(AuthConfig config) {
|
||||
super(config, AuthSource.TENCEN_CLOUD);
|
||||
super(config, AuthSource.TENCENT_CLOUD);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -58,7 +58,7 @@ public class AuthTencentCloudRequest extends BaseAuthRequest {
|
||||
.email(object.getString("email"))
|
||||
.remark(object.getString("slogan"))
|
||||
.token(authToken)
|
||||
.source(AuthSource.TENCEN_CLOUD)
|
||||
.source(AuthSource.TENCENT_CLOUD)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class UrlBuilder {
|
||||
private static final String WECHAT_REFRESH_TOKEN_PATTERN = "{0}?appid={1}&grant_type=refresh_token&refresh_token={2}";
|
||||
private static final String WECHAT_USER_INFO_PATTERN = "{0}?access_token={1}&openid={2}&lang=zh_CN";
|
||||
|
||||
private static final String TAOBAO_AUTHORIZE_PATTERN = "{0}?response_type=code&client_id={1}&redirect_uri={2}&state=&view=web";
|
||||
private static final String TAOBAO_AUTHORIZE_PATTERN = "{0}?response_type=code&client_id={1}&redirect_uri={2}&state={3}&view=web";
|
||||
private static final String TAOBAO_ACCESS_TOKEN_PATTERN = "{0}?client_id={1}&client_secret={2}&code={3}&redirect_uri={4}&grant_type=authorization_code";
|
||||
|
||||
private static final String FACEBOOK_AUTHORIZE_PATTERN = "{0}?client_id={1}&redirect_uri={2}&state={3}&response_type=code&scope=";
|
||||
@@ -503,7 +503,7 @@ public class UrlBuilder {
|
||||
* @return full url
|
||||
*/
|
||||
public static String getTaobaoAuthorizeUrl(String clientId, String redirectUrl) {
|
||||
return MessageFormat.format(TAOBAO_AUTHORIZE_PATTERN, ApiUrl.TAOBAO.authorize(), clientId, redirectUrl);
|
||||
return MessageFormat.format(TAOBAO_AUTHORIZE_PATTERN, ApiUrl.TAOBAO.authorize(), clientId, redirectUrl, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user