Blazor 不提供单独的会话。如何修复?

发布于 01-17 01:23 字数 525 浏览 4 评论 0原文

我有一个托管在 Azure 应用服务上的 Blazor 服务器应用,该应用与通过 Azure 上的 VNET 连接的本地服务器进行通信。

我有自定义身份验证,用户将使用其登录凭据,该登录凭据在返回令牌的本地服务器中进行验证。


现在我的问题是,似乎没有该应用程序的单独实例。 我之所以得出这个结论,是因为我遇到了以下情况:

我有一个 ZXing 条码扫描仪,它以以下方式显示解码后的条码:

<input type='text' value='@Barcode' disabled="disabled" />

一旦找到条码,该值就会显示在文本框中。

这是我的问题:

  1. 在我的手机PC上使用实时网址打开应用程序
  2. 我扫描手机上的代码
  3. PC的文本框已更新为我刚刚的代码用我的手机扫描的?

我是否缺少特定配置或者我误解了 Blazor 的工作原理?

I have a Blazor Server app hosted on an Azure App Service, which communicates to an on-premises server connected through a VNET on Azure.

I have custom authentication in place where a user will use their login credentials which is validated in the on-premises server which returns a token.


Now my issue is that it seems like there aren't individual instances of the app.
I've come to this conclusion because of the following scenario I've encountered:

I have a ZXing barcode scanner which displays a decoded barcode in the following manner:

<input type='text' value='@Barcode' disabled="disabled" />

The value is displayed in the textbox once a barcode is found.

Here is my issue:

  1. Open the app using live URL on my mobile phone and on my PC
  2. I scan the code on my phone
  3. The PC's textbox is updated with the code I just scanned on my phone?

Is there a specific configuration I'm missing or am I misunderstanding how Blazor works?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

金橙橙2025-01-24 01:23:11

原因是 BlazorBarcodeScanner.ZXing.JS,Blazor 条形码扫描仪

我手动实现了 JS 库,我的问题消失了。

The cause was the BlazorBarcodeScanner.ZXing.JS, Blazor barcode scanner .

I manually implemented the JS library and my problem disappeared.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文