feat: 添加登录页面 URL 检测功能;更新 H5ShellPage 状态管理以支持路由变化

This commit is contained in:
Booker
2026-05-27 13:16:35 +07:00
parent 6e3920972b
commit 179a2332ae
3 changed files with 119 additions and 1 deletions

View File

@@ -50,6 +50,20 @@ void main() {
expect(AppConfig.lineIndexForUrl('${lineUrl}login'), 0);
});
test('detects only H5 login routes for shell line switch display', () {
expect(
AppConfig.isLoginPageUrl('https://h5-test.imharry.work/login'), isTrue);
expect(AppConfig.isLoginPageUrl('https://h5-test.imharry.work/app/login'),
isTrue);
expect(AppConfig.isLoginPageUrl('https://h5-test.imharry.work/#/login'),
isTrue);
expect(AppConfig.isLoginPageUrl('https://h5-test.imharry.work/'), isFalse);
expect(AppConfig.isLoginPageUrl('https://h5-test.imharry.work/contact'),
isFalse);
expect(AppConfig.isLoginPageUrl('https://h5-test.imharry.work/getCode'),
isFalse);
});
test('refreshes an H5 route URL without adding branding to the URL', () {
final uri = Uri.parse(
AppConfig.withFreshShellParams(