小编Vik*_*han的帖子

'必须返回一个有效的React元素(或null)'与ReactJS中的一个组件一起出错

我的代码是这样的

var data = [
    {id: 1, taskName: "Pete Hunt", standarDescription: "This is one comment", emplComment: "meaaow I am meeawo", empRating : "1"},
    {id: 2, taskName: "Pete Hunt", standarDescription: "This is one comment", emplComment: "meaaow I am meeawo", empRating : "1"},
    {id: 3, taskName: "Pete Hunt", standarDescription: "This is one comment", emplComment: "meaaow I am meeawo", empRating : "1"},
    {id: 4, taskName: "Pete Hunt", standarDescription: "This is one comment", emplComment: "meaaow I am meeawo", empRating : "1"},
    {id: 5, taskName: …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs

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

未找到兼容的并排 NDK 版本。默认值为 20.0.5594570

我收到上述错误

我的gradle看起来像这样

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.example.hypersignwalletcorekotlin"
        minSdkVersion 23
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

}
project.ext {
    walletcore_version = "2.0.5"
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation "com.trustwallet:wallet-core:$walletcore_version"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
Run Code Online (Sandbox Code Playgroud)

无法理解为什么会发生这种情况。

谢谢

android android-ndk

18
推荐指数
3
解决办法
4万
查看次数

如何在Laravel5请求类中验证Money

我的验证类看起来像这样

<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class PaymentRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $rules = array(

                       'invoiceid'=>'required',
                       'recieved_amount'=>'required',
                       'ref_no'=>'required',
                       'date'=>'required',
                       'comment'=>'required'
                       );


    }
}
Run Code Online (Sandbox Code Playgroud)

我想验证recieved_amount为Money字段如果输入除money以外的任何其他内容,则应进行验证

任何人都可以帮助我

php validation laravel laravel-5.1

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

如果字符串不匹配,.split()会返回什么?

在这个JavaScript代码中,如果变量data没有那个字符.那么什么会分裂返回?

x = data.split('.');
Run Code Online (Sandbox Code Playgroud)

它会是原始字符串的数组吗?

javascript

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

在Laravel5中调用未定义的方法Illuminate\Http\Response :: json()

我试图用Laravel5中的json数组响应json

namespace App\Http\Controllers;
use Illuminate\Routing\ResponseFactory;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Event;

class EventsapiController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
        $events =  Event::All();

        return Response::json([

                'data'=>$events

        ],200);

    }
}
Run Code Online (Sandbox Code Playgroud)

它给了我这个错误

Call to undefined method Illuminate\Http\Response::json() in Laravel5
Run Code Online (Sandbox Code Playgroud)

那么我们如何在Laravel 5中传递json?,我已经知道laravel自动返回json数组,但我不想这样做

谢谢

php json laravel-5.1

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

RouteCollection.php第161行中的NotFoundHttpException:在laravel 5中

我知道这是关于堆栈溢出的非常常见的问题我尝试了很少但它在我的场景中不起作用.

我的CollectionController看起来像这样.

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Http\Middleware\Role;
use Illuminate\Support\Facades\Input;
use App\User;
use App\Invoice;
use Session;
use Validator;


    class CollectionController extends Controller
    {
        /**
         * Display a listing of the resource.
         *
         * @return Response
         */

      public function __construct(){

        $this->middleware('role:collector'); // replace 'collector' with whatever role you need.
    }


      public function getHome(){

          $empid= Auth::user()->empid;
          $invoice = Invoice::where('Status','=',1)->orderBy('Id', 'desc')->get();


        return View('collectionmodule/home')->with(array('invoices'=>$invoice));

     }

       public function getPayment(){

    dd('sssss');
             $id =$invoiceid;
             $invoice = Invoice::where('Id','=',$id)->payments()->comments()->get();

             return View('collectionmodule/payment')->with(array('invoice'=>$id));

     } …
Run Code Online (Sandbox Code Playgroud)

php laravel-5 laravel-5.2

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

如何使用甜蜜警报添加Ajax调用

我的Ajax方法看起来像这样

$.post(url,{
            ajax_call:"putDonation",
            addresse:addresse,
            phone:phone,
            email:email,
            name:name,
            amount:amount,
            amountinwords:amountinwords
           }).done(function(data){

            console.log(data);

            var arr = [];

            try {
                  var str = "";
                  //convert to json string
                      arr = $.parseJSON(data); //convert to javascript array
                      $.each(arr,function(key,value){
                        str +="<li>"+value+"</li>";
                    });
                       alert(str);
                       $(".alert-danger").show();
                       $("#error").html(str);

              } catch (e) {
                  swal("Jay Gayatri !", 'Donation Sucessful', "success")
                  $("#donation")[0].reset();
              }


           })
Run Code Online (Sandbox Code Playgroud)

我想展示一个像这样的甜蜜警报警告弹出窗口

   swal({   
                title: "Are you sure ?",   
                text: "You will not be able to recover this imaginary file!",   
                type: "warning",   
                showCancelButton: true,   
                confirmButtonColor: "#DD6B55",   
                confirmButtonText: "Yes, delete it!", …
Run Code Online (Sandbox Code Playgroud)

ajax jquery sweetalert

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

Laravel4在生产服务器中丢失了会话

我正在检查用户是否登录或不是这样

Class LoginController extends BaseController {

    public function getIndex(){
        return View::make('login',array('eventname' => Request::segment(1)));
    }

    public function postIndex(){

        $xx = User::where('email','=',Input::get('email'))->where('event','=',$requestedevent)->first();
        $eventattempt = Input::get('event');

        if ($xx){

                if(Auth::attempt($userDetails)){
                    if(Auth::check()){
                        // return var_dump($xx->id);
                        Session::put('username',Auth::user()->name);
                        Session::put('userid',Auth::user()->id);
                        Session::put('event',Auth::user()->event);
                        return Redirect::to($eventattempt.'/form/page1');
                    }
                } else {
                    return Redirect::to($eventattempt.'/login')->with('login_errors',true);
                }

        } else {
            return Redirect::to($eventattempt.'/login')->with('login_errors',true);
        }


    }

}
Run Code Online (Sandbox Code Playgroud)

然后我在这样的Form控制器中做一个过滤器

<?php



Class FormController extends BaseController{



    public function __construct(){
        $this->beforeFilter('auth');
        $this->beforeFilter('eventcheck');


    }

  }
Run Code Online (Sandbox Code Playgroud)

而我的filters.php看起来像这样

/*
|--------------------------------------------------------------------------
| Application & Route Filters
|--------------------------------------------------------------------------
|
| Below you will find the "before" …
Run Code Online (Sandbox Code Playgroud)

php session-variables laravel-4.2

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

如何使用Lets Encrypt为子域添加证书

我有一个NGINX服务器,我试图使用Let的加密添加SSL.

我的开发设置如下:

url : dev.domain.in
root: /var/www/dev/html
Run Code Online (Sandbox Code Playgroud)

制作如下:

url : domain.in
root: /var/www/production/html
Run Code Online (Sandbox Code Playgroud)

所以在我的nginx默认页面中,我有两个服务器块,一个用于开发,另一个用于生产

我想为两台服务器提供一个证书.

我知道根据Let's Encrypt网站的命令如下

cd/opt/letsencrypt ./letsencrypt-auto certonly -a webroot --webroot-path =/usr/share/nginx/html -d example.com -d www.example.com

但是,只有当SUBDOMAIN具有相同的webroot且在我的情况下不是真的时才能这样做.

那么我如何在这里添加CERT

请帮帮我

encryption ssl nginx ubuntu-14.04 lets-encrypt

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

如何从MySql中的表中获取最小id

我编写了一个 MySql 查询来获取与最小 id 相关的列。看起来像这样

SELECT min(id) as ID,feed , idpropiedad FROM `registrofeed` WHERE feed=21
Run Code Online (Sandbox Code Playgroud)

该表有 4 行,如下所示

在此输入图像描述

所以根据我写的函数

function setLC()
 {
    
     $sql = "
SELECT min(id) as ID
  , feed 
  , idpropiedad 
  FROM `registrofeed` 
 WHERE feed=21
";
     $result = $this->localDb->execute($sql);
     $row=mysql_fetch_array($result);
     echo $sql;
     echo $row['idpropiedad'];
     $this->lastCode = $row['idpropiedad'];
 }
Run Code Online (Sandbox Code Playgroud)

它为 idpropiedad 返回空字符串

任何人都可以帮我解决我哪里出错了

提前致谢

php mysql

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