|
@@ -68,6 +68,7 @@ import com.cooleshow.student.widgets.FileUtils;
|
|
|
import com.cooleshow.student.widgets.LollipopFixedWebView;
|
|
|
import com.cooleshow.student.widgets.helper.JsInterfaceUtils;
|
|
|
import com.cooleshow.usercenter.helper.UserHelper;
|
|
|
+import com.daya.live_teaching.model.UserInfo;
|
|
|
import com.daya.live_teaching.utils.GlideEngine;
|
|
|
import com.google.gson.Gson;
|
|
|
import com.gyf.immersionbar.ImmersionBar;
|
|
@@ -250,24 +251,8 @@ public class MallFragment extends BaseMVPFragment<FragmentMallBinding, ShopMallP
|
|
|
@Override
|
|
|
public void onResume() {
|
|
|
super.onResume();
|
|
|
- if (null != webView && App.isRefresh) {
|
|
|
- String userToken = UserHelper.getUserToken();
|
|
|
- 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);
|
|
|
- }
|
|
|
- }
|
|
|
- webView.loadUrl(webViewUrl);
|
|
|
- App.isRefresh = false;
|
|
|
+ if (null != webView) {
|
|
|
+ sendTokenCallBack();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1087,6 +1072,20 @@ public class MallFragment extends BaseMVPFragment<FragmentMallBinding, ShopMallP
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void sendTokenCallBack() {
|
|
|
+ String userToken = UserHelper.getUserToken();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ JSONObject contentJson = new JSONObject();
|
|
|
+ try {
|
|
|
+ jsonObject.put("api", "UpdateToken");
|
|
|
+ contentJson.put("token", userToken);
|
|
|
+ jsonObject.put("content", contentJson);
|
|
|
+ onSendMessage(jsonObject.toString());
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 发送支付结果
|
|
|
*
|