From 8c8bab4843fc68d8707a2168874caf21d08a7c64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=81=E6=B5=A9=E7=84=B6?= Date: Fri, 15 Nov 2024 17:55:18 +0800 Subject: [PATCH] docs: Add the usage of urlInterrupter for app-slide --- packages/app-slide/README-zh.md | 6 ++++++ packages/app-slide/README.md | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/packages/app-slide/README-zh.md b/packages/app-slide/README-zh.md index 23552b6..8bfc27f 100644 --- a/packages/app-slide/README-zh.md +++ b/packages/app-slide/README-zh.md @@ -13,6 +13,12 @@ WindowManager.register({ appOptions: { // 打开这个选项显示 debug 工具栏 debug: false, + urlInterrupter: async (url: string) => { + // 一般会有不同的实现,比如签名。 + const { ak, expire } = await getSTSToken(); // 客户的客户端实现。 + return `${url}?expire=${expire}&ak=${ak}`; + }, + // 更多选项可以在 https://github.com/netless-io/netless-slide-demo#slide-%E9%85%8D%E7%BD%AE 查看 }, src: async () => { const app = await import("@netless/app-slide"); diff --git a/packages/app-slide/README.md b/packages/app-slide/README.md index 00d48d4..65e9d8f 100644 --- a/packages/app-slide/README.md +++ b/packages/app-slide/README.md @@ -15,6 +15,13 @@ WindowManager.register({ appOptions: { // turn on to show debug controller debug: false, + urlInterrupter: async (url: string) => { + // There will be different implementations depending on different cloud storage services. + // Generally, signatures are added to the query parameters. + const { ak, expire } = await getSTSToken(); // Customer service side implementation. + return `${url}?expire=${expire}&ak=${ak}`; + // https://github.com/netless-io/netless-slide-demo#slide-%E9%85%8D%E7%BD%AE for more options + }, }, src: async () => { const app = await import("@netless/app-slide");