fix: pathSegments越界
This commit is contained in:
@ -52,7 +52,10 @@ class WebviewController extends GetxController {
|
||||
loadProgress.value = progress;
|
||||
},
|
||||
onPageStarted: (String url) {
|
||||
final String str = Uri.parse(url).pathSegments[0];
|
||||
final List pathSegments = Uri.parse(url).pathSegments;
|
||||
if (pathSegments.isNotEmpty &&
|
||||
url != 'https://passport.bilibili.com/h5-app/passport/login') {
|
||||
final String str = pathSegments[0];
|
||||
final Map matchRes = IdUtils.matchAvorBv(input: str);
|
||||
final List matchKeys = matchRes.keys.toList();
|
||||
if (matchKeys.isNotEmpty) {
|
||||
@ -63,6 +66,7 @@ class WebviewController extends GetxController {
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 加载完成
|
||||
onUrlChange: (UrlChange urlChange) async {
|
||||
|
Reference in New Issue
Block a user