feat: deliver RSchedule service login exams and elastic glass navigation
This commit is contained in:
@@ -1,4 +1,21 @@
|
||||
class SchoolNavigationPolicy {
|
||||
static Uri? secureIdentityRedirect(Uri uri) {
|
||||
if (uri.scheme != 'http' ||
|
||||
uri.port != 80 ||
|
||||
uri.userInfo.isNotEmpty ||
|
||||
uri.host != 'idas.uestc.edu.cn' ||
|
||||
uri.path != '/authserver/login') {
|
||||
return null;
|
||||
}
|
||||
return Uri(
|
||||
scheme: 'https',
|
||||
host: uri.host,
|
||||
path: uri.path,
|
||||
query: uri.hasQuery ? uri.query : null,
|
||||
fragment: uri.hasFragment ? uri.fragment : null,
|
||||
);
|
||||
}
|
||||
|
||||
static bool canNavigate(Uri uri, {required bool isMainFrame}) => isMainFrame
|
||||
? isSchoolPage(uri)
|
||||
: (uri.scheme == 'https' && uri.userInfo.isEmpty) ||
|
||||
@@ -17,6 +34,18 @@ class SchoolNavigationPolicy {
|
||||
r'$',
|
||||
).hasMatch(uri.path);
|
||||
static bool isSchoolPage(Uri uri) =>
|
||||
(_https(uri) &&
|
||||
const {
|
||||
'idas.uestc.edu.cn',
|
||||
'yjsjy.uestc.edu.cn',
|
||||
}.contains(uri.host)) ||
|
||||
(uri.scheme == 'http' &&
|
||||
uri.port == 80 &&
|
||||
uri.userInfo.isEmpty &&
|
||||
uri.host == 'yjsjy.uestc.edu.cn' &&
|
||||
uri.path.startsWith('/pyxx/'));
|
||||
static bool isExam(Uri uri) =>
|
||||
_https(uri) &&
|
||||
const {'idas.uestc.edu.cn', 'yjsjy.uestc.edu.cn'}.contains(uri.host);
|
||||
uri.host == 'yjsjy.uestc.edu.cn' &&
|
||||
uri.path == '/pyxx/pygl/kskcxx/index';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user