[Modify]修改Accept-Language字段

This commit is contained in:
wushaocheng
2023-05-23 11:34:26 +08:00
parent 3762a73b57
commit 826e27d529
3 changed files with 4 additions and 2 deletions

View File

@@ -98,6 +98,7 @@ import org.greenrobot.eventbus.EventBus;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@@ -396,6 +397,7 @@ public class XChatApplication extends BaseApp {
httpParams.put("deviceId", DeviceUuidFactory.getDeviceId(context)); httpParams.put("deviceId", DeviceUuidFactory.getDeviceId(context));
httpParams.put("androidId", MD5Utils.getMD5String(Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID))); httpParams.put("androidId", MD5Utils.getMD5String(Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID)));
httpParams.put("channel", AppMetaDataUtil.getChannelID()); httpParams.put("channel", AppMetaDataUtil.getChannelID());
httpParams.put("Accept-Language", Locale.getDefault().getLanguage());
RxNet.init(context) RxNet.init(context)
.debug(BuildConfig.DEBUG) .debug(BuildConfig.DEBUG)
.setBaseUrl(url) .setBaseUrl(url)

View File

@@ -474,7 +474,7 @@ public class JSInterface {
jsonObject.put("appVersionCode", String.valueOf(AppUtils.getVersionCode(context))); jsonObject.put("appVersionCode", String.valueOf(AppUtils.getVersionCode(context)));
jsonObject.put("deviceId", DeviceUtil.getDeviceId(context)); jsonObject.put("deviceId", DeviceUtil.getDeviceId(context));
jsonObject.put("channel", AppMetaDataUtil.getChannelID()); jsonObject.put("channel", AppMetaDataUtil.getChannelID());
jsonObject.put("accept-language", Locale.getDefault().getLanguage()); jsonObject.put("Accept-Language", Locale.getDefault().getLanguage());
Log.e(TAG, "getDeviceInfo: " + jsonObject); Log.e(TAG, "getDeviceInfo: " + jsonObject);
return jsonObject.toJSONString(); return jsonObject.toJSONString();
} }

View File

@@ -112,7 +112,7 @@ public class SimpleJSInterface {
jsonObject.put("appVersion", VersionUtil.getLocalName(context)); jsonObject.put("appVersion", VersionUtil.getLocalName(context));
jsonObject.put("appVersionCode", String.valueOf(AppUtils.getVersionCode(context))); jsonObject.put("appVersionCode", String.valueOf(AppUtils.getVersionCode(context)));
jsonObject.put("channel", getChannel()); jsonObject.put("channel", getChannel());
jsonObject.put("accept-language", Locale.getDefault().getLanguage()); jsonObject.put("Accept-Language", Locale.getDefault().getLanguage());
Log.e(TAG, "getDeviceInfo: " + jsonObject); Log.e(TAG, "getDeviceInfo: " + jsonObject);
return jsonObject.toJSONString(); return jsonObject.toJSONString();
} }