小编Adi*_*iri的帖子

如何在css中创建100%垂直线

我想创建一个覆盖整个页面的垂直线

在此输入图像描述

这是我的代码

#menu
{
border-left: 1px solid black;
height: 100%;
}
Run Code Online (Sandbox Code Playgroud)

结果显示像这样 在此输入图像描述

html css html5 css3

14
推荐指数
3
解决办法
12万
查看次数

安装php5-mcrypt时出错

就在今天,我注册了Google Cloud Compute Engine.我做了一切,但后来我在安装php5-mcrypt扩展时遇到了错误.错误:

root@instance-2:~# sudo apt-get install php5-mcrypt
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php5-mcrypt : Depends: phpapi-20121212 …
Run Code Online (Sandbox Code Playgroud)

php ubuntu mcrypt google-compute-engine server

8
推荐指数
1
解决办法
5502
查看次数

laravel - CSRF 令牌总是在变化

嗯,这就是我昨天面临的问题。它总是给我TokenMismatchException,当我深入研究并比较一些东西时,我发现在我的本地服务器上,该_token字段永远不会改变。但在我的生产中,它确实如此。这就是它不断给我的原因TokenMismatchException。有谁知道如何解决这个错误。

我有

  1. 看到这个问题
  2. 通过文档。
  3. 编写了多个代码接收测试。
  4. <input id="token" type="hidden" value="{{ csrf_token() }}"> 这已经在我的代码中了。

php csrf laravel laravel-5

4
推荐指数
1
解决办法
3766
查看次数

Laravel 5 Ajax帖子

嗨,我真的很难在laravel 5中的新结构,我试图通过AJAX帖子提交表单,但我一直收到错误422(错误的请求).我错过了什么或者我需要对我的Request类做些什么吗?这是我的代码:

控制器:

public function login(LoginRequest $request)
{

    if ($this->auth->attempt($request->only('email', 'password')))
    {
        return redirect("/");
    }

    return response()->json(['errors'=>$request->response]);
}
Run Code Online (Sandbox Code Playgroud)

LoginRequest文件(我添加了一个自定义响应方法):

public function response(array $errors)
{
    if ($this->ajax() || $this->wantsJson())
    {
        return response()->json($errors, 422);
    }

    return response()->json($errors);
}
Run Code Online (Sandbox Code Playgroud)

我的ajax代码:

$("#form-login").submit(function(){

  var selector = $(this);
  $.ajax({
     url: selector.attr("action"),
     type: "post",
     data: selector.serialize(),
     dataType: "json",
  }).done(function(data){
     console.log(data);
     if(data.status == "failed"){
       alert("error");
     }else{
        alert("success");
     }
  });

  return false;
});
Run Code Online (Sandbox Code Playgroud)

所以我的问题是,当我提交表单时,我可以从我的控制台看到 - 无法加载资源:服务器响应状态为422(错误请求)

请有人帮忙.提前致谢!

ajax laravel laravel-5

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

Typescript - 在数组的 for 循环中对字符串进行类型更改

我已经在特定类型的数组上声明了 for 循环。当我在 for 循环中使用这个数组时,我收到错误,因为打字稿将其检测为字符串类型,而不是声明的特定项目的类型。

const repos: Repo[] = config.get("repos");
for(const repo in repos) {
  calculate(repo)
}
Run Code Online (Sandbox Code Playgroud)

我收到错误消息,我传递给计算的值不是 Repo 类型,而是 string 类型。

注意:这不是运行时错误。我在 VS Code 中使用代码 ts(2345) 时得到它

types typescript

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

标签 统计

laravel ×2

laravel-5 ×2

php ×2

ajax ×1

csrf ×1

css ×1

css3 ×1

google-compute-engine ×1

html ×1

html5 ×1

mcrypt ×1

server ×1

types ×1

typescript ×1

ubuntu ×1