小编bha*_*rat的帖子

如何将数组数据作为 formdata angular 4 发送

我试图发布一组未发送到服务器的数据:

网络服务:

 deleteCategory() {
    return  this.http.post('http://www.demo/webapi/deletecategory', { 
        headers: {
          "Authorization": "Token " + this.token,
          "Content-Type": "application/x-www-form-urlencoded"
        },
        withCredentials: true
      }
      )
    }
Run Code Online (Sandbox Code Playgroud)

在 ts 文件中

onDelete() {
      this.userService.deleteCategory().subscribe(response => {
      this.selectedArray = [];
     for (var i = 0; i< this.selection._selected.length; i++){
     this.selectedArray.push(this.selection._selected[i].category_id) ;
     console.log(' selected value:', this.selectedArray);

     }
    })
      }
Run Code Online (Sandbox Code Playgroud)

在 html 中

<button class="btn-danger pull-right" (click)="onDelete()" type="button"  >Delete</button>
Run Code Online (Sandbox Code Playgroud)

http-post angular-http angular

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

Laravel 使用 queue() 发送邮件在服务器上不起作用

我尝试使用 Laravel 队列作业和 Hostmonster Web 服务器上的网站发送邮件,但当我触发时它不会发送邮件php artisan queue:work,它会清除作业表,但不会清除收到到我的电子邮件地址的邮件。

这是我的排队和发送邮件功能的代码:

    //It is working
    $to = '****@g***l.com';
    \Mail::to($to)->send(new ContactUsMail($contactUsId));

    //It is not working: on same host email working not work with hotmail - gmail - other
    $to = '****@g***l.com';
    \Mail::to($to)->queue(new ContactUsMail($contactUsId));
Run Code Online (Sandbox Code Playgroud)

邮件发送工作正常,有两种情况:

  1. 如果我使用send()方法发送邮件(绕过/忽略队列)
  2. 也使用queue()发送到同一托管电子邮件(如info@myhost.com

但现在如果我使用xyz@yahoo.com/xyz@gmail.com那么在这种情况下队列不起作用 - 作业表也会删除发送邮件时的条目,但宾果..!! 邮件发到哪里我不知道。

另外 cron mail 与队列简单mail()功能相同的问题在那里工作但Mail::send()在那里不起作用..!

php email laravel laravel-mail

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

Bootstrap Selectpicker 不适用于全局模式

我用这个制作了一个全局模式

<div id="GlobalModal" class="modal fade" role="dialog">
 <div class="modal-dialog">
    <style>
        #GlobalModal .modal-body .body-content {
            margin:0;
            width: 100%;
        }
    </style>
    <!-- Modal content-->
    <div class="modal-content">
        <div class="modal-header" style="background:#337ab7;">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h4 class="modal-title" style="color:white">Not set...</h4>
        </div>
         <div class="modal-body">

         </div>
         <div class="modal-footer">
            <button type="button" class="btn btn-primary">Save</button>
            <button type="button" class="btn btn-warning" data-dismiss="modal">Close</button>
        </div>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

这是我调用模态的按钮

<button id="new-communication" type="button" class="btn btn-info btn-sm">NEW <i class="glyphicon glyphicon-plus"></i></button>
Run Code Online (Sandbox Code Playgroud)

这是内容

<div class="hidden">
 <div id="mc-communication">
  <form id="loginForm"  class="form-horizontal" role="form" method="POST" action="" >
  <div class="form-group">
    <label class="col-sm-2 control-label">Type</label>
      <div …
Run Code Online (Sandbox Code Playgroud)

javascript css php jquery twitter-bootstrap

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