酒吧房小黑屋麦标显示,网络请求头添加版本信息。

This commit is contained in:
2026-01-17 16:29:39 +08:00
parent 16bd6d7e1a
commit ac7a3b1325
3 changed files with 11 additions and 8 deletions

View File

@@ -98,9 +98,7 @@ public class RetrofitClient {
private OkHttpClient provideOkHttpClient() {
Map<String, String> headers = Collections.emptyMap();
if (SpUtil.isAgreePolicy()) {
headers = SystemUtils.getSystemParams();
}
headers = SystemUtils.getSystemParams();
SetCookieCache cookieCache = new SetCookieCache();
ClearableCookieJar cookieJar =
new PersistentCookieJar(cookieCache, new SharedPrefsCookiePersistor(CommonAppContext.getInstance()));
@@ -123,6 +121,10 @@ public class RetrofitClient {
sslContext = SSLContext.getInstance("SSL");
sslContext.init(null, new TrustManager[]{trustAllCert}, new SecureRandom());
headers.entrySet().stream()
.forEach(entry -> LogUtils.e("Header: %-20s Value: %s", entry.getKey(), entry.getValue()));
final OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(new DataLoggingInterceptor(new DataLogger()))
.addInterceptor(new AccessTokenInterceptor(headers))