fix: 评论区链接解析
This commit is contained in:
@ -12,6 +12,7 @@ import 'package:pilipala/pages/preview/index.dart';
|
|||||||
import 'package:pilipala/pages/video/detail/index.dart';
|
import 'package:pilipala/pages/video/detail/index.dart';
|
||||||
import 'package:pilipala/pages/video/detail/reply_new/index.dart';
|
import 'package:pilipala/pages/video/detail/reply_new/index.dart';
|
||||||
import 'package:pilipala/utils/feed_back.dart';
|
import 'package:pilipala/utils/feed_back.dart';
|
||||||
|
import 'package:pilipala/utils/id_utils.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import 'package:pilipala/utils/url_utils.dart';
|
import 'package:pilipala/utils/url_utils.dart';
|
||||||
import 'package:pilipala/utils/utils.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
@ -641,6 +642,18 @@ InlineSpan buildContent(
|
|||||||
title,
|
title,
|
||||||
'',
|
'',
|
||||||
);
|
);
|
||||||
|
} else {
|
||||||
|
final String pathSegment = Uri.parse(matchStr).path;
|
||||||
|
Map matchRes = IdUtils.matchAvorBv(input: pathSegment);
|
||||||
|
List matchKeys = matchRes.keys.toList();
|
||||||
|
if (matchKeys.isNotEmpty) {
|
||||||
|
UrlUtils.matchUrlPush(
|
||||||
|
matchRes.containsKey('AV')
|
||||||
|
? matchRes['AV']! as int
|
||||||
|
: matchRes['BV'],
|
||||||
|
title,
|
||||||
|
matchStr,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
final String redirectUrl =
|
final String redirectUrl =
|
||||||
await UrlUtils.parseRedirectUrl(matchStr);
|
await UrlUtils.parseRedirectUrl(matchStr);
|
||||||
@ -649,16 +662,6 @@ InlineSpan buildContent(
|
|||||||
SmartDialog.showToast('地址可能有误');
|
SmartDialog.showToast('地址可能有误');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final String pathSegment = Uri.parse(redirectUrl).path;
|
|
||||||
final String lastPathSegment =
|
|
||||||
pathSegment.split('/').last;
|
|
||||||
if (lastPathSegment.startsWith('BV')) {
|
|
||||||
UrlUtils.matchUrlPush(
|
|
||||||
lastPathSegment,
|
|
||||||
title,
|
|
||||||
redirectUrl,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
Get.toNamed(
|
Get.toNamed(
|
||||||
'/webview',
|
'/webview',
|
||||||
parameters: {
|
parameters: {
|
||||||
|
|||||||
Reference in New Issue
Block a user