提交 b9ca048d 编写于 作者: 智布道's avatar 智布道 👁

修复部分问题,详情见update.md

上级 a07dcbd2
......@@ -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());
}
/**
......
......@@ -2,6 +2,8 @@
1. 增加抖音和Linkedin的授权登陆
2. 修改部分图片命名
3. 优化部分代码
4. 修复`AuthSource`中腾讯云开发平台的拼写错误:`TENCEN_CLOUD`->`TENCENT_CLOUD`
5. 修复支付宝登陆时用户名为空的问题
### 2019/05/24
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册