fix: pathSegments越界
This commit is contained in:
@ -52,15 +52,19 @@ class WebviewController extends GetxController {
|
|||||||
loadProgress.value = progress;
|
loadProgress.value = progress;
|
||||||
},
|
},
|
||||||
onPageStarted: (String url) {
|
onPageStarted: (String url) {
|
||||||
final String str = Uri.parse(url).pathSegments[0];
|
final List pathSegments = Uri.parse(url).pathSegments;
|
||||||
final Map matchRes = IdUtils.matchAvorBv(input: str);
|
if (pathSegments.isNotEmpty &&
|
||||||
final List matchKeys = matchRes.keys.toList();
|
url != 'https://passport.bilibili.com/h5-app/passport/login') {
|
||||||
if (matchKeys.isNotEmpty) {
|
final String str = pathSegments[0];
|
||||||
if (matchKeys.first == 'BV') {
|
final Map matchRes = IdUtils.matchAvorBv(input: str);
|
||||||
Get.offAndToNamed(
|
final List matchKeys = matchRes.keys.toList();
|
||||||
'/searchResult',
|
if (matchKeys.isNotEmpty) {
|
||||||
parameters: {'keyword': matchRes['BV']},
|
if (matchKeys.first == 'BV') {
|
||||||
);
|
Get.offAndToNamed(
|
||||||
|
'/searchResult',
|
||||||
|
parameters: {'keyword': matchRes['BV']},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user