我在Laravel 5.3的哈希机制中遇到了一个奇怪的错误。
WITH NumberedSet as
(
SELECT
Date,
Abc,
ROW_NUMBER() OVER(ORDER BY Date ASC) as Num
FROM [YourTable]
)
, BeginEndFlagedSet as
(
SELECT
This.Num,
This.Date,
This.Abc,
CASE
WHEN This.Abc IS NOT NULL AND Prev.Abc IS NULL THEN 'Start'
WHEN This.Abc IS NOT NULL AND Next.Abc IS NULL THEN 'End'
END as BeginEndFlag
FROM NumberedSet as This
LEFT JOIN NumberedSet as Prev
on This.Num = Prev.Num + 1
LEFT JOIN NumberedSet as Next
on This.Num = Next.Num - 1
)
这是定义它的代码。
// Create a new PDF document
PdfDocument document = new PdfDocument();
// Create a font
XFont font = new XFont("Times", 25, XFontStyle.Bold);
PageSize[] pageSizes = (PageSize[])Enum.GetValues(typeof(PageSize));
foreach (PageSize pageSize in pageSizes)
{
if (pageSize == PageSize.Undefined)
continue;
// One page in Portrait...
PdfPage page = document.AddPage();
page.Size = pageSize;
XGraphics gfx = XGraphics.FromPdfPage(page);
gfx.DrawString(pageSize.ToString(), font, XBrushes.DarkRed,
new XRect(0, 0, page.Width, page.Height),
XStringFormat.Center);
// ... and one in Landscape orientation.
page = document.AddPage();
page.Size = pageSize;
page.Orientation = PageOrientation.Landscape;
gfx = XGraphics.FromPdfPage(page);
gfx.DrawString(pageSize.ToString() + " (landscape)", font,
XBrushes.DarkRed, new XRect(0, 0, page.Width, page.Height),
XStringFormat.Center);
}
// Save the document...
string filename = "PageSizes.pdf";
document.Save(filename);
// ...and start a viewer.
Process.Start(filename);
这里发生了什么?我觉得它没有从数据库中获取密码值,因此我们收到错误,但我不确定原因。这个名字是正确的。
答案 0 :(得分:2)
您在Input :: get()而不是check()中传递2个参数。你必须纠正括号位置
if ($val && Hash::check(Input::get('Password'), $val->Password))
答案 1 :(得分:1)
我认为你的括号不在正确的地方
你有:
Hash::check(Input::get('Password', $val->Password))
我认为你必须将括号移到:
Hash::check(Input::get('Password'), $val->Password)
答案 2 :(得分:1)
不确定Hash :: check的工作原理,但这里
x = 0.5(cx + bx)
y = 0.5(cy + by)
你只给了它一个参数。
答案 3 :(得分:1)
我认为你的括号中有错误。
if ($val && Hash::check(Input::get('Password', $val->Password)))
成为
if ($val && Hash::check(Input::get('Password'), $val->Password))