Commit 116dee96 authored by sheteng's avatar sheteng

h5返回

parent 7577d189
......@@ -237,20 +237,20 @@ class AccelertorFragment : XPageFragment() {
AcceleratorUtils.getGameList(this) {
if (it) {
//
// AcceleratorUtils.game?.let {
// if (!SysUtils.isPackageInstall(requireContext(), it.packageName)) {
// binding.quickTopToast.visibility = View.VISIBLE
// binding.quickTopToastTx.setText("请先安装游戏后加速")
// binding.quickTopToastTx.postDelayed({
// binding.quickTopToast.visibility = View.GONE
// }, 2000)
// DataRePortUtils.report(
// "st_speed_result",
// mapOf("result" to 0, "cause" to "1")
// )
// return@getGameList
// }
// }
AcceleratorUtils.game?.let {
if (!SysUtils.isPackageInstall(requireContext(), it.packageName)) {
binding.quickTopToast.visibility = View.VISIBLE
binding.quickTopToastTx.setText("请先安装游戏后加速")
binding.quickTopToastTx.postDelayed({
binding.quickTopToast.visibility = View.GONE
}, 2000)
DataRePortUtils.report(
"st_speed_result",
mapOf("result" to 0, "cause" to "1")
)
return@getGameList
}
}
//用户是否有使用时长
LoginUtils.getUserHasTimer(this@AccelertorFragment) {
if (it) {
......
......@@ -10,6 +10,7 @@ import android.widget.FrameLayout
import androidx.fragment.app.Fragment
import com.ccwangluo.accelerator.databinding.FragmentWebviewBinding
import com.ccwangluo.accelerator.utils.LoginUtils
import com.github.shadowsocks.http.HttpConfig
import com.just.agentweb.core.AgentWeb
import com.just.agentweb.core.client.DefaultWebClient
import com.xuexiang.xpage.annotation.Page
......@@ -38,7 +39,7 @@ class CommonWebViewFragment : XPageFragment() {
url?.let {
var weburl = it
LoginUtils.token?.let {
if (weburl.contains("?")){
if (weburl.contains("?")) {
weburl = weburl + "&token=$it"
} else {
weburl = weburl + "?token=$it"
......@@ -112,11 +113,19 @@ class CommonWebViewFragment : XPageFragment() {
override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
if (keyCode == KeyEvent.KEYCODE_BACK) {
agentWeb?.let {
it.webCreator.webView.url?.let { url ->
if (url.contains(HttpConfig.MEMBER_CENTER)) {
it.getJsAccessEntrace()
.quickCallJs("goback")
return true
} else {
if (it.back()) {
return true
}
}
}
}
}
return super.onKeyDown(keyCode, event)
}
......
......@@ -4,16 +4,16 @@ object HttpConfig {
//app后端
//val baseUrl = "http://10.16.1.98:9002"
val baseUrl = "https://test-cc-tt-api.orangenet.org.cn" //测试
// val baseUrl = "https://cc-tt-front.srccwl.com" //生产
// val baseUrl = "https://test-cc-tt-api.orangenet.org.cn" //测试
val baseUrl = "https://cc-tt-front.srccwl.com" //生产
/**
* 主页h5
*/
val UI_MAIN_URL = "https://test-cc-tt-front.orangenet.org.cn/#" //测试
// val UI_MAIN_URL = "http://10.3.64.200:8080/#"
// val UI_MAIN_URL = "https://cc-tt-front.srccwl.com/#" //生产
// val UI_MAIN_URL = "https://test-cc-tt-front.orangenet.org.cn/#" //测试
val UI_MAIN_URL = "https://cc-tt-front.srccwl.com/#" //生产
//隐私协议地址
val HTML_HOST_PRIVACY="https://sdk-static.srccwl.com/tt_html/"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment