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

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))

View File

@@ -5,7 +5,6 @@ import android.os.Build;
import com.blankj.utilcode.util.AppUtils;
import com.blankj.utilcode.util.MetaDataUtils;
import com.chad.library.BuildConfig;
import com.xscm.moduleutil.base.CommonAppContext;
import com.xscm.moduleutil.utils.config.ConfigUtils;
@@ -106,9 +105,9 @@ public class SystemUtils {
public static Map<String, String> getSystemParams() {
Map<String, String> headers = new HashMap<>();
headers.put("deviceId", SystemUtils.getShortClientID(CommonAppContext.getInstance()));
headers.put("appVersion", BuildConfig.VERSION_NAME + "." + BuildConfig.VERSION_CODE);
headers.put("versionName", BuildConfig.VERSION_NAME);
headers.put("versionCode", String.valueOf(BuildConfig.VERSION_CODE));
headers.put("appId", CommonAppContext.getInstance().appId);
headers.put("versionName", CommonAppContext.getInstance().appVersionName);
headers.put("versionCode", CommonAppContext.getInstance().appVersionCode);
headers.put("system", "android");
headers.put("emulator", CommonAppContext.getInstance().emulator);
headers.put("deviceName", SystemUtils.getDeviceBrand() + SystemUtils.getSystemModel() + SystemUtils.getSystemVersion());

View File

@@ -1593,7 +1593,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
roomFragment!!.handleRoomMessage(messageEvent)
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSingerRoomCurrentSongDidChanged) { //点歌房当前歌曲发生变化)
if (mRoomInfoResp != null && mRoomInfoResp!!.room_info != null) {
if (messageEvent?.text?.song_info != null) {
if (messageEvent.text?.song_info != null) {
mRoomInfoResp?.singer_info?.song_info = messageEvent.text.song_info
roomBtnShowIsHide(mRoomInfoResp?.singer_info?.song_info?.singer_user_id!!)
} else {
@@ -3115,6 +3115,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
}
mRoomInfoResp?.user_info?.pit_number = 9527
roomBtnShowIsHide()
}
/** 进入小黑屋将所有的底部隐藏 */