我正在使用带有宅基地的窗户,我正试图在命令行上输入流浪汉,但我收到此错误:
C:/www/Homestead/scripts/homestead.rb:106:in
read': No such file or directory @ rb_sysopen - C:/Users/Niall/.ssh/id_rsa (Errno::ENOENT) from C:/www/Homestead/scripts/homestead.rb:106:in
block(2 level)in configure'from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/kernel_v2/config/ vm_provisioner.rb:72:在call' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/kernel_v2/config/vm_provisioner.rb:72:in
C的add_config'中:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/kernel_v2/config/vm.rb:321:provision' from C:/www/Homestead/scripts/homestead.rb:103:in
在configure 中的块中来自C:/ www/Homestead/scripts/homestead.rb:102:在each' from C:/www/Homestead/scripts/homestead.rb:102:in
配置'来自C:/ www/Homestead/Vagrantfile:20:inblock in <top (required)>' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/v2/loader.rb:37:in
call'来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/ lib/vagrant/config/v2/loader.rb:37:在load' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:113:in
块中(2级)加载'来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader .rb:107:each' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:107:in
来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb的加载块:104:each' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:104:in
来自C:/ HashiCorp的加载/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/vagrantfile.rb:28:ininitialize' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:740:in
新的'来自C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/ vagrant/environment.rb:740:在vagrantfile' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:486:in
主机'来自C:/ HashiCorp/Vagrant/embedded/gems/gems/vagra nt-1.8.1/lib/vagrant/environment.rb:208:block in action_runner' from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:33:in
来自C的电话:/ HashiCorp/Vagrant/embedded/gems/gems /vagrant-1.8.1/lib/vagrant/ action/runner.rb:33 :run' from …
我正在尝试将 CSRF 令牌添加到我的表单中。问题是,当我将其添加到文件中时,我会回显会话令牌,并且它与名为“token”的输入中的令牌相匹配。但是,当我提交页面并使用 Token::check 时,它返回 false,如果我再次从输入和会话中回显令牌值,我会看到会话值已更改,但输入值保持不变。
<?php
class Token{
public static function generate(){
return $_SESSION['token'] = base64_encode(openssl_random_pseudo_bytes(32));
}
public static function check($token){
if(isset($_SESSION['token']) && $token == $_SESSION['token']){
unset($_SESSION['token']);
return true;
}else{
return false;
}
}
}
?>
Run Code Online (Sandbox Code Playgroud)
这是控制表单的php。
$token = $_POST['token'];
if(Token::check($token)){ //Continue with more code }
Run Code Online (Sandbox Code Playgroud)
以下是处理令牌的表单部分:
<input type="hidden" name="user_id_update" value="<?php echo $user_info[0][0]->id; ?>"/>
<input type="hidden" name="time_update" value="<?php echo $time; ?>"/>
<input type="hidden" name="token" value="<?php echo Token::generate(); ?>"
<hr />
<div class="form-group">
<input type="submit" id="submit_update" value="Update" class="btn btn-success"/>
</div> …
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 apollo 托管解决方案中的托管配置在本地运行 apollo 网关。它加载架构并且一切都很好,但是当我在 Playground 中尝试查询时,我得到“仅支持 HTTP(S) 协议”。我知道我可以使用 serviceList,但我希望能够使用 apollo 图管理器在 POC 本地运行它。这似乎是阿波罗使用的节点获取的问题,因为它甚至没有调用底层数据源并且在网关处失败。
/* istanbul ignore file */
import {ApolloServer} from 'apollo-server';
import {ApolloGateway} from '@apollo/gateway';
const {
NODE_ENV,
} = process.env;
const gateway: ApolloGateway = new ApolloGateway();
const main = async () => {
return new ApolloServer({
gateway,
playground: NODE_ENV !== 'production',
subscriptions: false,
});
}
export default main;
Run Code Online (Sandbox Code Playgroud)
我在网上到处搜索,似乎找不到答案,所以任何帮助将不胜感激。有什么想法如何让它在本地工作吗?提前致谢。
我正在尝试开始使用laravel php框架.我试图只是调用索引文件,我收到此错误消息.
C:\ xampp\php\php.exe C:\ xampp\htdocs\tutorials\lara\application\public\index.php
致命错误:在第357行的C:\ xampp\htdocs\tutorials\lara\application\bootstrap\cache\compiled.php中找不到界面'Illuminate\Auth\Illuminate\Contracts\Auth\Factory'
处理以退出代码255结束
任何人都可以对这意味着什么?
我目前正在学习Angular和打字稿,而Angular文档的这部分导致了一个问题.有人可以=>
在下面的例子中给出如何使用它的解释吗?我在网上搜索并找到了对lambda函数和返回类型的引用,但是我找不到任何与=>
此处使用相匹配的东西.
export class DashboardComponent implements OnInit {
heroes: Hero[] = [];
constructor(private heroService: HeroService) { }
ngOnInit() {
this.heroService.getHeroes()
.then(heroes => this.heroes = heroes.slice(1, 5));
}
gotoDetail() { /* not implemented yet */}
}
Run Code Online (Sandbox Code Playgroud)
如果有人能帮助我理解这一点我会非常感激.
之前我问过这个问题,但是无法得到答案.我能够使用方法:'得到'如下,让它工作,所以它没关系,但这次我需要使用post.在一个不同的项目中(使用react,redux,php,webpack,xampp),同样的问题已经重新出现,我正试图弄明白.所以这里是:
register.php
echo $_GET['task'];
Run Code Online (Sandbox Code Playgroud)
index.js
const values = {task: 'doSomething', username: 'username'}
axios({
url: "./server/register.php",
timeout: 20000,
method: 'get',
params: values
}).then(function(response){console.log(response.data)})
Run Code Online (Sandbox Code Playgroud)
当我执行上述操作时,一切正常,数据将记录为"doSomething".但是,当我尝试使用axios({method:'POST'})并将php更改为$ _POST ['task']时,我收到一条错误消息,说$ _POST ['task']未定义如下:
index.js
axios({
url: "/projects/myProject/server/register.php",
method: 'post',
data: values
}).then(function(response){console.log(response.data)})
Run Code Online (Sandbox Code Playgroud)
register.php
echo $_POST['task'];
Run Code Online (Sandbox Code Playgroud)
注意:未定义的索引:任务
当我使用axios.post()尝试这个时,我遇到了完全相同的问题.我想在这里使用帖子请求.任何人都可以为我阐明这一点吗?