Skip to content

Commit

Permalink
perf
Browse files Browse the repository at this point in the history
  • Loading branch information
1962247851 committed Jul 16, 2024
1 parent ef788b4 commit ba9d0ce
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.springframework.web.reactive.function.client.WebClient;
import tech.ordinaryroad.auth.server.api.IOAuth2Api;
import tech.ordinaryroad.auth.server.request.OAuth2GetOrNumberRequest;
import tech.ordinaryroad.commons.base.cons.StatusCode;
import tech.ordinaryroad.commons.core.base.result.Result;
import tech.ordinaryroad.commons.satoken.properties.OAuth2ClientProperties;
import tech.ordinaryroad.gateway.properties.OrGatewayProperties;
Expand Down Expand Up @@ -154,6 +155,12 @@ private Result<JSONObject> exchangeToken(JSONObject params, Boolean rememberMe)
} else {
return Result.fail("不支持 " + grantType);
}
if (tokenData.containsKey("code") && tokenData.containsKey("msg")) {
Integer code = tokenData.getInteger("code");
if (StatusCode.SUCCESS.getCode() != code) {
return Result.fail(tokenData.getString("msg"));
}
}

// 根据openid获取其对应的userId
String openid = tokenData.getString("openid");
Expand Down

0 comments on commit ba9d0ce

Please sign in to comment.