Merge branch 'fix'
This commit is contained in:
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:appscheme/appscheme.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@ -11,6 +12,7 @@ import 'package:pilipala/models/video/reply/item.dart';
|
|||||||
import 'package:pilipala/pages/preview/index.dart';
|
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/app_scheme.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/id_utils.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
@ -643,34 +645,17 @@ InlineSpan buildContent(
|
|||||||
'',
|
'',
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
final String pathSegment = Uri.parse(matchStr).path;
|
Uri uri = Uri.parse(matchStr);
|
||||||
Map matchRes = IdUtils.matchAvorBv(input: pathSegment);
|
SchemeEntity scheme = SchemeEntity(
|
||||||
List matchKeys = matchRes.keys.toList();
|
scheme: uri.scheme,
|
||||||
if (matchKeys.isNotEmpty) {
|
host: uri.host,
|
||||||
UrlUtils.matchUrlPush(
|
port: uri.port,
|
||||||
matchRes.containsKey('AV')
|
path: uri.path,
|
||||||
? matchRes['AV']! as int
|
query: uri.queryParameters,
|
||||||
: matchRes['BV'],
|
source: '',
|
||||||
title,
|
dataString: matchStr,
|
||||||
matchStr,
|
);
|
||||||
);
|
PiliSchame.fullPathPush(scheme);
|
||||||
} else {
|
|
||||||
final String redirectUrl =
|
|
||||||
await UrlUtils.parseRedirectUrl(matchStr);
|
|
||||||
// if (redirectUrl == matchStr) {
|
|
||||||
// Clipboard.setData(ClipboardData(text: matchStr));
|
|
||||||
// SmartDialog.showToast('地址可能有误');
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
Get.toNamed(
|
|
||||||
'/webview',
|
|
||||||
parameters: {
|
|
||||||
'url': redirectUrl,
|
|
||||||
'type': 'url',
|
|
||||||
'pageTitle': title
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (appUrlSchema.startsWith('bilibili://search')) {
|
if (appUrlSchema.startsWith('bilibili://search')) {
|
||||||
|
@ -95,7 +95,7 @@ class PiliSchame {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (scheme == 'https') {
|
if (scheme == 'https') {
|
||||||
_fullPathPush(value);
|
fullPathPush(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ class PiliSchame {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<void> _fullPathPush(SchemeEntity value) async {
|
static Future<void> fullPathPush(SchemeEntity value) async {
|
||||||
// https://m.bilibili.com/bangumi/play/ss39708
|
// https://m.bilibili.com/bangumi/play/ss39708
|
||||||
// https | m.bilibili.com | /bangumi/play/ss39708
|
// https | m.bilibili.com | /bangumi/play/ss39708
|
||||||
// final String scheme = value.scheme!;
|
// final String scheme = value.scheme!;
|
||||||
@ -135,8 +135,6 @@ class PiliSchame {
|
|||||||
Map<String, String>? query = value.query;
|
Map<String, String>? query = value.query;
|
||||||
RegExp regExp = RegExp(r'^((www\.)|(m\.))?bilibili\.com$');
|
RegExp regExp = RegExp(r'^((www\.)|(m\.))?bilibili\.com$');
|
||||||
if (regExp.hasMatch(host)) {
|
if (regExp.hasMatch(host)) {
|
||||||
print('bilibili.com host: $host');
|
|
||||||
print('bilibili.com path: $path');
|
|
||||||
final String lastPathSegment = path!.split('/').last;
|
final String lastPathSegment = path!.split('/').last;
|
||||||
if (path.startsWith('/video')) {
|
if (path.startsWith('/video')) {
|
||||||
Map matchRes = IdUtils.matchAvorBv(input: path);
|
Map matchRes = IdUtils.matchAvorBv(input: path);
|
||||||
@ -236,6 +234,24 @@ class PiliSchame {
|
|||||||
print('个人空间');
|
print('个人空间');
|
||||||
Get.toNamed('/member?mid=$area', arguments: {'face': ''});
|
Get.toNamed('/member?mid=$area', arguments: {'face': ''});
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
final Map<String, dynamic> map =
|
||||||
|
IdUtils.matchAvorBv(input: area.split('?').first);
|
||||||
|
if (map.containsKey('AV')) {
|
||||||
|
_videoPush(map['AV']! as int, null);
|
||||||
|
} else if (map.containsKey('BV')) {
|
||||||
|
_videoPush(null, map['BV'] as String);
|
||||||
|
} else {
|
||||||
|
Get.toNamed(
|
||||||
|
'/webview',
|
||||||
|
parameters: {
|
||||||
|
'url': value.dataString ?? "",
|
||||||
|
'type': 'url',
|
||||||
|
'pageTitle': ''
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user