从身份验证页面返回后,是否可以保留全局变量`窗口.__ tauri__“?
我正在使用单登录的公司设置中使用陶里。当我提供网页时,它将重定向到身份验证页面,然后将其转发到我的原始URL。
我有withglobaltauri
设置为true
,但是window .__ Tauri __
从身份验证返回时会删除对象。
我了解加载新页面时应该清除窗口
对象,但是Tauri是否有可能在新页面加载上重新注射全局Tauri变量?以及如何?
还是我唯一的重新加载陶里作为模块的选择?如:
import { invoke } from '@tauri-apps/api/tauri'
I'm using Tauri in a corporate setting with single sign-on. When I serve my webpage, it redirects to an authentication page and then forwards on to my original url.
I have withGlobalTauri
set to true
, but the window.__TAURI__
object is deleted when returning from authentication.
I understand the window
object is supposed to be cleared when loading new pages, but is it possible for tauri to reinject the global tauri variable on new page loads? and how?
Or is my only option to reload tauri as a module? as in:
import { invoke } from '@tauri-apps/api/tauri'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我收到一个答案,
(较小的应用程序大小,更好的安全性),因此不,不应该保留全局变量,无论如何最好将其用作导入语句。
I received an answer that
So no, the global variable is not supposed to be retained, and it's better to use as an import statement anyway.