|
@@ -135,7 +135,8 @@ public class AccompanyActivity extends BaseActivity<ActivityAccompanyBinding> {
|
|
|
}
|
|
|
|
|
|
setStatusBarTextColor(intent.getBooleanExtra("statusBarTextColor", true));
|
|
|
- webViewUrl = url;
|
|
|
+ addToken(url);
|
|
|
+
|
|
|
accompanyFragment = AccompanyFragment.newInstance(webViewUrl);
|
|
|
accompanyFragment.setOnAccompanyListener(new AccompanyFragment.onListener() {
|
|
|
|
|
@@ -318,6 +319,24 @@ public class AccompanyActivity extends BaseActivity<ActivityAccompanyBinding> {
|
|
|
startService(intentOne);
|
|
|
}
|
|
|
|
|
|
+ private void addToken(String url) {
|
|
|
+ String userToken = UserHelper.getUserToken();
|
|
|
+ String Authorization = TextUtils.isEmpty(userToken) ? null : userToken;
|
|
|
+ if (!TextUtils.isEmpty(Authorization)) {
|
|
|
+ try {
|
|
|
+ authorization = URLEncoder.encode(Authorization, "UTF-8");
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ boolean status = url.contains("?");
|
|
|
+ if (status) {
|
|
|
+ webViewUrl = (url + "&Authorization=" + authorization);
|
|
|
+ } else {
|
|
|
+ webViewUrl = (url + "?Authorization=" + authorization);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@SuppressLint("CheckResult")
|
|
|
private void toStartCapture() {
|
|
|
Observable.create(new ObservableOnSubscribe<Object>() {
|