接入桌面壳深链
新增Tauri桌面深链模块并归一到同源H5入口 启用deep-link插件与single-instance深链转发 更新原生壳门禁和架构文档
This commit is contained in:
@@ -493,6 +493,11 @@ for (const [sectionName, dependencyName, expectedLine] of [
|
||||
'tauri-plugin-dialog',
|
||||
'tauri-plugin-dialog = "2.7.1"',
|
||||
],
|
||||
[
|
||||
'dependencies',
|
||||
'tauri-plugin-deep-link',
|
||||
'tauri-plugin-deep-link = "2.4.9"',
|
||||
],
|
||||
[
|
||||
'dependencies',
|
||||
'tauri-plugin-notification',
|
||||
@@ -506,7 +511,7 @@ for (const [sectionName, dependencyName, expectedLine] of [
|
||||
[
|
||||
'dependencies',
|
||||
'tauri-plugin-single-instance',
|
||||
'tauri-plugin-single-instance = "2.4.2"',
|
||||
'tauri-plugin-single-instance = { version = "2.4.2", features = ["deep-link"] }',
|
||||
],
|
||||
]) {
|
||||
assertCargoDependencyLine(sectionName, dependencyName, expectedLine);
|
||||
@@ -519,6 +524,7 @@ for (const [packageName, expectedVersion] of [
|
||||
['serde_json', '1.0.150'],
|
||||
['tauri', '2.11.2'],
|
||||
['tauri-plugin-clipboard-manager', '2.3.2'],
|
||||
['tauri-plugin-deep-link', '2.4.9'],
|
||||
['tauri-plugin-dialog', '2.7.1'],
|
||||
['tauri-plugin-notification', '2.3.3'],
|
||||
['tauri-plugin-opener', '2.5.4'],
|
||||
@@ -534,6 +540,7 @@ for (const [dependencyName, expectedVersion] of [
|
||||
['serde_json', '1.0.150'],
|
||||
['tauri', '2.11.2'],
|
||||
['tauri-plugin-clipboard-manager', '2.3.2'],
|
||||
['tauri-plugin-deep-link', '2.4.9'],
|
||||
['tauri-plugin-dialog', '2.7.1'],
|
||||
['tauri-plugin-notification', '2.3.3'],
|
||||
['tauri-plugin-opener', '2.5.4'],
|
||||
@@ -1039,12 +1046,22 @@ const requiredRustHostModules = [
|
||||
'host_bridge/protocol.rs',
|
||||
'host_bridge/share.rs',
|
||||
'main.rs',
|
||||
'shell/deep_link.rs',
|
||||
'shell/mod.rs',
|
||||
'shell/tray.rs',
|
||||
'shell/webview.rs',
|
||||
];
|
||||
const requiredRustHostSnippets = [
|
||||
'tauri_plugin_single_instance::init',
|
||||
'tauri_plugin_deep_link::init()',
|
||||
'register_desktop_deep_link_events(app)',
|
||||
'register_desktop_deep_link_schemes(app)',
|
||||
'DeepLinkExt',
|
||||
'app.deep_link().on_open_url',
|
||||
'app.deep_link().get_current()',
|
||||
'app.deep_link().register_all()',
|
||||
'normalize_desktop_deep_link_url',
|
||||
'DESKTOP_DEEP_LINK_HOSTS',
|
||||
'resolve_desktop_single_instance_action',
|
||||
'tauri_plugin_clipboard_manager::init()',
|
||||
'TrayIconBuilder::with_id',
|
||||
@@ -1203,8 +1220,25 @@ if (cargoManifest.includes('"devtools"')) {
|
||||
throw new Error('desktop shell must not enable Tauri devtools feature');
|
||||
}
|
||||
|
||||
if (!cargoManifest.includes('tauri-plugin-single-instance = "2.4.2"')) {
|
||||
throw new Error('desktop shell must depend on tauri-plugin-single-instance');
|
||||
if (
|
||||
!cargoManifest.includes(
|
||||
'tauri-plugin-single-instance = { version = "2.4.2", features = ["deep-link"] }',
|
||||
)
|
||||
) {
|
||||
throw new Error('desktop shell must depend on tauri-plugin-single-instance with deep-link feature');
|
||||
}
|
||||
|
||||
if (!cargoManifest.includes('tauri-plugin-deep-link = "2.4.9"')) {
|
||||
throw new Error('desktop shell must depend on tauri-plugin-deep-link');
|
||||
}
|
||||
|
||||
if (
|
||||
!config.plugins ||
|
||||
!config.plugins['deep-link'] ||
|
||||
JSON.stringify(config.plugins['deep-link']?.desktop?.schemes ?? []) !==
|
||||
JSON.stringify(['genarrative'])
|
||||
) {
|
||||
throw new Error('desktop shell deep-link plugin must register only the genarrative scheme');
|
||||
}
|
||||
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user