feat: 升级jdk17
This commit is contained in:
@@ -21,7 +21,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import sun.misc.BASE64Encoder;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@@ -217,8 +217,7 @@ public class ApiController {
|
||||
*/
|
||||
private String getBase64ClientParam() {
|
||||
byte[] authorization = (clientId + ":" + clientSecret).getBytes(StandardCharsets.UTF_8);
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
return encoder.encode(authorization);
|
||||
return Base64.encodeBase64String(authorization);
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
@@ -22,6 +22,10 @@
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-context</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import sun.misc.BASE64Encoder;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
@@ -73,8 +73,7 @@ public class ApiController {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
||||
byte[] authorization = (clientId + ":" + clientSecret).getBytes("UTF-8");
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
String base64Auth = encoder.encode(authorization);
|
||||
String base64Auth = Base64.encodeBase64String(authorization);
|
||||
headers.add("Authorization", "Basic " + base64Auth);
|
||||
|
||||
MultiValueMap<String, String> param = new LinkedMultiValueMap<>();
|
||||
|
||||
Reference in New Issue
Block a user