小编Win*_*box的帖子

当只有一个子文件夹时,VS Code 不显示子文件夹

我的 VS Code 在只有一个文件夹时不显示子文件夹,只有在有 2 个或更多文件夹时才显示。我附上了一个截图来展示一个例子。我想让它显示所有文件夹。我一直在寻找如何让它返回显示所有文件夹,但找不到方法。

vs代码截图

如果我添加更多文件夹,它会恢复正常。即使它是 Input 中唯一的文件夹,我也会让它显示 Search 文件夹。

在此处输入图片说明

visual-studio-code

53
推荐指数
2
解决办法
2万
查看次数

如何设置 cookie express,react.js

我正在为 node.js 和 react.js 使用 express 构建登录系统。在我的后端,当用户登录时,它会创建一个 cookie。当我转到网络 > 登录时,我可以看到:

设置 Cookie:user_id=s%3A1.E%2FWVGXrIgyXaM4crLOoxO%2Fur0tdjeN6ldABcYOgpOPk;路径=/;HttpOnly; 安全的

但是当我转到 Application > Cookies > http://localhost:3000 时,那里什么也没有。我相信这是因为当我从客户端发出发布请求时,我不允许凭据正确通过。我该怎么做?请让我知道我是否可以以任何方式改进我的问题。

            //Login back-end
            router.post('/login', (req, res, next) => {
                if(validUser(req.body)) {
                    User
                        .getOneByEmail(req.body.email)
                        .then(user => {
                            if(user) {
                                bcrypt
                                    .compare(req.body.password_digest, user.password_digest)
                                    .then((result) => {
                                        if(result) {
                                            const isSecure = process.env.NODE_ENV != 'development';

                                            res.cookie('user_id', user.id, {
                                                httpOnly: true,
                                                secure: isSecure,
                                                signed: true
                                            })
                                            res.json({
                                                message: 'Logged in'
                                            });
                                        } else {
                                            next(new Error('Invalid Login'))
                                        }
                                    });
                            } else {
                                next(new Error('Invalid …
Run Code Online (Sandbox Code Playgroud)

node.js express reactjs

8
推荐指数
2
解决办法
2万
查看次数

如何使用 go_router 包将过渡动画应用到 .go 函数

我正在使用 go_router 包,因为我需要它提供的深层链接。我将动画过渡应用于某些路线,但它们是静态的,因此每次我转到该路线时,都会触发相同的动画。当我这样做时我想改变动画GoRouter.of(context).go('/inbox')

这就是我现在所拥有的:

final router = GoRouter(
  initialLocation: '/inbox',
  routes: <GoRoute>[
    GoRoute(
      path: '/inbox',
      pageBuilder: (BuildContext context, GoRouterState state) {
        return PageTransition.slideFromRight(
          myChildWidget: Layout(
            context: context,
            state: state,
            child: EmailPage(),
          ),
          state: state,
        );
      },
    ),
    GoRoute(
      path: '/email/inbox/:id',
      pageBuilder: (BuildContext context, GoRouterState state) {
        return PageTransition.slideFromLeft(
          myChildWidget: Layout(
            context: context,
            state: state,
            child: const EmailDetailsPage(),
          ),
          state: state,
        );
      },
    ),
    GoRoute(
      path: '/menu',
      pageBuilder: (BuildContext context, GoRouterState state) {
        return PageTransition.slideFromRight(
          myChildWidget: Layout(
            context: context,
            state: …
Run Code Online (Sandbox Code Playgroud)

android ios dart flutter flutter-go-router

6
推荐指数
1
解决办法
3268
查看次数