Merge pull request #10 from xkcoding/fix-response-code

♻️ 添加返回状态码
This commit is contained in:
yadong.zhang 2019-05-23 19:12:17 +08:00 committed by GitHub
commit e70dae0b85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,9 +36,9 @@ public abstract class BaseAuthRequest implements AuthRequest {
public AuthResponse login(String code) {
try {
AuthUser user = this.getUserInfo(this.getAccessToken(code));
return AuthResponse.builder().data(user).build();
return AuthResponse.builder().code(ResponseStatus.SUCCESS.getCode()).data(user).build();
} catch (Exception e) {
return AuthResponse.builder().code(500).msg(e.getMessage()).build();
return AuthResponse.builder().code(ResponseStatus.FAILURE.getCode()).msg(e.getMessage()).build();
}
}