feat: 升级jdk17

This commit is contained in:
zlt2000
2023-08-01 17:08:46 +08:00
parent adc037d213
commit c7dfbc9e39
5 changed files with 38 additions and 17 deletions
@@ -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<>();