小编Ale*_*lex的帖子

Bitbucket 没有显示最近的提交,但提交仍然存在

我们已经在同一个 Bitbucket 存储库中工作了将近三年。我们有一个用于生产的主分支,用于测试的开发,然后是大量的功能分支。今天我想创建一个合并到开发中的拉取请求,但是在 PR 视图中我收到消息“没有在 [branch] 上没有开发的提交”。然后在提交概览页面上有很多提交丢失。Develop 似乎根本没有提交,缺少对某些功能分支的提交,而对于其他分支,所有提交都存在。

管道确实成功运行,如果我单击最近提交的提交哈希(在管道视图中),它会显示我最近的提交,以及我之前推送的所有更改。Bitbucket 中的源代码也反映了这些更改,而 master 和 develop 缺少这些更改(换句话说,肯定有尚未开发的提交)。

最后,命令喜欢git loggit reflog显示所有分支的所有更改。

这目前阻止我们推出相当多的更改,而且我在任何地方都找不到有关解决方案(或原因)的任何信息,因此我们将不胜感激。

编辑:我刚刚将另一个分支推送到远程,并且神奇地所有提交都重新出现了,包括其他分支的提交。不知道逻辑是什么,但问题已经解决了。

git commit bitbucket

6
推荐指数
4
解决办法
3481
查看次数

将五个div对齐

我目前正在建立一个网站,您可以在其中找到一级方程式比赛的结果.为此,我想为每个大奖赛制作一个结果页面,其结果显示在彼此相邻的5个方框中.像这样:

1 2 3 4 5
Run Code Online (Sandbox Code Playgroud)

但是现在它看起来像这样

1 2
   3
4    5
Run Code Online (Sandbox Code Playgroud)

这是我使用的HTML代码:

<div id="wrap">
    <div id="fp1">FP1</div>
    <div id="fp2">FP2</div>
    <div id="fp3">FP3</div>
    <div id="qual">Qual</div>
    <div id="race">Race</div>
</div> <!--End wrap div-->
Run Code Online (Sandbox Code Playgroud)

这就是我使用的CSS:

#wrap{
width: 100%;
height: 600px;
background-color: #000;
border: 1px solid white;
}
#fp1{
width: 20%;
height: 600px;
background-color: #333;
float: left;
}
#fp2{
margin-left: 20%;
width: 20%;
height: 600px;
background-color: #666;
}
#fp3{
margin-left: 40%;
width: 20%;
height: 600px;
background-color: #333;
}
#qual{
margin-left: 60%;
width: 20%;
height: 600px;
background-color: …
Run Code Online (Sandbox Code Playgroud)

html css alignment

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

Laravel:Cookie::forget() 不起作用

我在删除 Laravel 5.6 中的 cookie 时遇到问题。我已经尝试了基于thisthisthisthis question 的各种不同的东西,但它们都不起作用;

1.

return response()
    ->redirectToRoute('home')
    ->withCookie(Cookie::forget('code'))
    ->withCookie(Cookie::forget('email'));
Run Code Online (Sandbox Code Playgroud)

2.

Cookie::queue(Cookie::forget('code'));
Cookie::queue(Cookie::forget('email'));

return redirect('/');
Run Code Online (Sandbox Code Playgroud)

3.

Cookie::queue('code', null, -1);
Cookie::queue('email', null, -1);

return redirect('/');
Run Code Online (Sandbox Code Playgroud)

4.

return redirect('/')
    ->withCookie(cookie('code', '', -1))
    ->withCookie(cookie('email', '', -1));
Run Code Online (Sandbox Code Playgroud)

5.

return response()
    ->redirectToRoute('home')
    ->withCookie(cookie('code', '', -1))
    ->withCookie(cookie('email', '', -1));
Run Code Online (Sandbox Code Playgroud)

3、4、5甚至没有改变cookie的值,原始值仍然保留在cookie中。我不知道我可以尝试哪些其他方法,因此将不胜感激。

Laravel 中一般是这样添加 Cookie 的:

return response()
    ->redirectToRoute($this->handleRedirect($result))
    ->cookie('code', $request->code, $this->duration, null, $this->domain)
    ->cookie('email', $request->email, $this->duration, null, $this->domain);
Run Code Online (Sandbox Code Playgroud)

php cookies laravel

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

NestJS - 检查失败时将用户从警卫重定向

我在我正在构建的 NestJS 应用程序中添加了一些简单、有效的登录功能。我现在想阻止已注销用户访问某些路由,因此我添加了一个简单的AuthGuard,如下所示;

@Injectable()
export class AuthGuard implements CanActivate {
    public canActivate(
        context: ExecutionContext,
    ): boolean {
        const request = context.switchToHttp().getRequest();
        const response = context.switchToHttp().getResponse();
        if (typeof request.session.authenticated !== "undefined" && request.session.authenticated === true) {
            return true;
        }
        return false;
    }
}
Run Code Online (Sandbox Code Playgroud)

这样做的方式是阻止用户访问应用了守卫的路由,但这样做只会显示此 JSON 响应;

{
    "statusCode": 403,
    "error": "Forbidden",
    "message": "Forbidden resource"
}
Run Code Online (Sandbox Code Playgroud)

我想要的是当守卫失败时用户被重定向到登录页面。我试过用return falsewith替换response.redirect("/auth/login");,虽然它有效,但在控制台中我收到消息

(node:11526) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Can't set headers after they are sent.

(node:11526) [DEP0018] …

redirect nestjs

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

标签 统计

alignment ×1

bitbucket ×1

commit ×1

cookies ×1

css ×1

git ×1

html ×1

laravel ×1

nestjs ×1

php ×1

redirect ×1