KComponent
KComponent copied to clipboard
same request can't launch twice in a second
val currentTime = System.currentTimeMillis()
// 如果把系统时间修改到当前时间之前,这里会一直 throw NavigationException
if (map.containsKey(hostAndPath) && currentTime - map[hostAndPath]!! < requiredConfig().routeRepeatCheckDuration) {
throw NavigationException("same request can't launch twice in a second, target uri is:$uri")
} else {
......
}
那你这。。。 你这是属于 App 没杀掉改的时间吧. 如果在 App 运行期间不改, 是不会有这个问题的 如果你实在介意, 你可以禁用这个功能, 有配置的
是 App 没杀掉改的时间。
已经使用下面的配置禁用了:
Config.Builder()
.useRouteRepeatCheckInterceptor(false)
.build()
但 OpenOnceInterceptor 还是很有用的,是不是把 currentTime - map[hostAndPath]!! 取个绝对值来代表 1 秒内。
你小子, 说的很有道理哦. 我有空招你说的改, 然后发个版