feat: 新增CTC云端笔记仓库功能
- 新增多语言国际化文案支持笔记仓库模块 - 配置Universal Links与App Links支持ctc.s2ss.com域名跳转 - 实现CTS会话入口与会话时间更新逻辑 - 新增CTC笔记完整服务栈:API客户端、本地存储、同步服务 - 新增笔记编辑、预览、冲突解决、版本对比组件 - 新增二维码扫码/分享功能与路由配置 - 修复UrlAnalyzerService调用参数冗余问题 - 修复ProfileHeader组件样式问题 - 统一macOS部署目标版本为13.0 - 抑制liquid_glass_widgets高频调试日志
This commit is contained in:
@@ -183,6 +183,10 @@ class AppRouter {
|
||||
|
||||
if (scheme == 'https' || scheme == 'http') {
|
||||
final host = uri.host.toLowerCase();
|
||||
// CTC 子域名专用解析: https://ctc.s2ss.com/<key> → /ctc/notes/edit?key=<key>
|
||||
if (host == 'ctc.s2ss.com') {
|
||||
return DeepLinkResolver.resolveCtcDomain(uri);
|
||||
}
|
||||
if (host == 's2ss.com' || host == 'www.s2ss.com') {
|
||||
return DeepLinkResolver.resolveHttps(uri);
|
||||
}
|
||||
|
||||
@@ -42,6 +42,9 @@ class AppRoutes {
|
||||
static const String qrcodeLogin = '/qrcode-login';
|
||||
static const String noteList = '/notes';
|
||||
static const String noteEdit = '/notes/edit';
|
||||
static const String ctcNoteList = '/ctc/notes';
|
||||
static const String ctcNoteEdit = '/ctc/notes/edit';
|
||||
static const String ctcSettings = '/ctc/settings';
|
||||
static const String statistics = '/statistics';
|
||||
static const String correction = '/correction';
|
||||
static const String hanziTool = '/hanzi-tool';
|
||||
|
||||
@@ -80,6 +80,22 @@ class DeepLinkResolver {
|
||||
_entries = null;
|
||||
}
|
||||
|
||||
// ===========================================================
|
||||
// CTC 域名专用解析
|
||||
// ===========================================================
|
||||
|
||||
/// 解析 https://ctc.s2ss.com/<key> 通用链接
|
||||
/// 格式: https://ctc.s2ss.com/<key>
|
||||
/// 映射到: /ctc/notes/edit?key=<key>
|
||||
static String? resolveCtcDomain(Uri uri) {
|
||||
final segments = uri.pathSegments;
|
||||
if (segments.isEmpty) return AppRoutes.ctcNoteList;
|
||||
|
||||
// 提取第一个路径段作为 key
|
||||
final key = segments.first;
|
||||
return '${AppRoutes.ctcNoteEdit}?key=$key';
|
||||
}
|
||||
|
||||
// ===========================================================
|
||||
// 解析入口
|
||||
// ===========================================================
|
||||
|
||||
@@ -70,6 +70,9 @@ import 'package:xianyan/features/file_transfer/collaboration/screen_share/pages/
|
||||
|
||||
import 'package:xianyan/features/note/presentation/note_list_page.dart';
|
||||
import 'package:xianyan/features/note/presentation/note_edit_page.dart';
|
||||
import 'package:xianyan/features/ctc/presentation/pages/ctc_note_list_page.dart';
|
||||
import 'package:xianyan/features/ctc/presentation/pages/ctc_note_edit_page.dart';
|
||||
import 'package:xianyan/features/ctc/presentation/pages/ctc_settings_page.dart';
|
||||
import 'package:xianyan/features/tool_center/statistics/presentation/statistics_page.dart';
|
||||
import 'package:xianyan/features/correction/presentation/correction_page.dart';
|
||||
import 'package:xianyan/features/discover/presentation/pages/home/inspiration_page.dart';
|
||||
@@ -641,6 +644,37 @@ final List<RouteDef> routeRegistry = [
|
||||
return NoteEditPage(noteId: noteId == 0 ? null : noteId);
|
||||
},
|
||||
),
|
||||
// CTC 笔记仓库路由
|
||||
RouteDef(
|
||||
path: AppRoutes.ctcNoteList,
|
||||
name: 'ctc-note-list',
|
||||
module: RouteModule.content,
|
||||
page: () => const CtcNoteListPage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
deepLinkAliases: [
|
||||
'xianyan://ctc/notes',
|
||||
'https://s2ss.com/ctc/notes',
|
||||
],
|
||||
),
|
||||
RouteDef(
|
||||
path: AppRoutes.ctcNoteEdit,
|
||||
name: 'ctc-note-edit',
|
||||
module: RouteModule.content,
|
||||
builder: (ctx) {
|
||||
final key = ctx.getQueryParam('key');
|
||||
return CtcNoteEditPage(noteKey: key);
|
||||
},
|
||||
deepLinkAliases: [
|
||||
'xianyan://ctc/notes/edit',
|
||||
'https://ctc.s2ss.com/*',
|
||||
],
|
||||
),
|
||||
RouteDef(
|
||||
path: AppRoutes.ctcSettings,
|
||||
name: 'ctc-settings',
|
||||
module: RouteModule.content,
|
||||
page: () => const CtcSettingsPage(),
|
||||
),
|
||||
RouteDef(
|
||||
path: AppRoutes.statistics,
|
||||
name: 'statistics',
|
||||
|
||||
Reference in New Issue
Block a user