小编sud*_*ngh的帖子

postgresql 中的临时表是否在所有客户端会话中可见?

我想创建一个临时表,以便能够将它连接到几个表,因为将这些表与建议的临时表的内容连接起来需要很多时间(获取临时表的内容很耗时。重复它一遍又一遍地花费越来越多的时间)。当我的需要完成时,我将删除临时表。我想知道这些临时表是否在其他客户端会话中可见(我的要求是让它们仅对当前客户端会话可见)。我正在使用 postgresql。如果您能为我正在考虑的解决方案提出更好的替代方案,那就太好了。

sql postgresql performance join postgresql-performance

9
推荐指数
2
解决办法
4706
查看次数

如何重置路由器中的位置状态

我正在关注react-router文档来创建受保护的路由HOC,对于未经身份验证的请求,我将用户重定向如下:

<Redirect to={{
  pathname: '/input-number',
  state: { from: props.location },
}} />
Run Code Online (Sandbox Code Playgroud)

现在在重定向组件上,我使用以下逻辑显示错误消息:

      this.props.location.state && this.props.location.state.from &&
      (
        <Grid.Row>
          <Grid.Column>
            <Message negative>
              <Message.Header>You must be logged in to visit the page</Message.Header>
            </Message>
          </Grid.Column>
        </Grid.Row>
      )
Run Code Online (Sandbox Code Playgroud)

问题是当用户重新加载时,页面与位置关联的状态不会被清除,并且一旦用户被重定向到登录组件,每次刷新时都会显示错误消息.我正在寻找一种清除状态的方法.我认为必须可以在不设置应用状态的情况下实现.

更新:为了清楚起见,我添加了完整的PrivateRoute:

`

export default function PrivateRoute({ component: Component, ...rest }) {
  const isAuthenticated = localStorage.getItem(ACCESS_TOKEN);
  return (
    <Route
      {...rest}
      render={props => (
        isAuthenticated ? (
          <Component {...props} />
        ) : (
          <Redirect to={{
            pathname: '/input-number',
            state: { from: props.location },
          }}
          />
        ) …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-router

7
推荐指数
2
解决办法
8648
查看次数

无法在 Chrome 中找到 OTPCredential

我正在尝试在网络中构建 OTP 自动读取。我读到 Chrome 提供了 OTPCredential(此处)。'OTPCredential' in window但是,即使版本高于 84,我尝试的每个移动 chrome 浏览器上的检查也会失败。他们现在删除了支持吗?

html javascript google-chrome

5
推荐指数
1
解决办法
1983
查看次数