From 639166d3f8119e8b73fc390fc555efb8ef505090 Mon Sep 17 00:00:00 2001 From: orz12 Date: Thu, 14 Mar 2024 12:25:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20www.bilibili.com/xxx/xxx=E7=B3=BB?= =?UTF-8?q?=E5=88=97=E7=BD=91=E9=A1=B5=E9=93=BE=E6=8E=A5=E6=89=93=E5=BC=80?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/utils/app_scheme.dart | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/lib/utils/app_scheme.dart b/lib/utils/app_scheme.dart index bb9d556f..49dee376 100644 --- a/lib/utils/app_scheme.dart +++ b/lib/utils/app_scheme.dart @@ -20,7 +20,7 @@ class PiliSchame { /// 完整链接进入 b23.无效 appScheme.getLatestScheme().then((SchemeEntity? value) { if (value != null) { - _fullPathPush(value); + _routePush(value); } }); @@ -155,7 +155,7 @@ class PiliSchame { final String host = value.host!; final String? path = value.path; Map? query = value.query; - RegExp regExp = RegExp(r'^(www\.)?m?\.(bilibili\.com)$'); + RegExp regExp = RegExp(r'^((www\.)|(m\.))?bilibili\.com$'); if (regExp.hasMatch(host)) { print('bilibili.com'); } else if (host.contains('live')) { @@ -203,7 +203,8 @@ class PiliSchame { } if (path != null) { - final String area = path.split('/').last; + List pathPart = path.split('/'); + final String area = pathPart[1] == 'mobile' ? pathPart[2] : pathPart[1]; switch (area) { case 'bangumi': print('番剧'); @@ -231,6 +232,16 @@ class PiliSchame { print('个人空间'); Get.toNamed('/member?mid=$area', arguments: {'face': ''}); break; + default: + SmartDialog.showToast('未知路径或匹配错误:${value.dataString},先采用浏览器打开'); + Get.toNamed( + '/webview', + parameters: { + 'url': value.dataString ?? "", + 'type': 'url', + 'pageTitle': '' + }, + ); } } }