我试图在数组中插入一个值但是当我尝试插入值时,它给了我未定义的Connot set Property'0'.但显然我已经定义了数组.
错误行:
this.enemyMinions[i] = new EnemyCombatMinion(new Minion(enemyMinionInfo[0], 0, enemyMinionInfo[1], enemyMinionInfo[2], enemyMinionInfo[3], 0, 0, 0, 0, 0, 0));
Run Code Online (Sandbox Code Playgroud)
这是整个代码:
function Combat() {
this.enemyMinions = [];
this.playerMinions = [];
this.currentEnemyMinion = null;
this.currentPlayerMinion = null;
}
Combat.prototype.initialize = function() {
var o = 0;
for(var i = 0; i < partySlots.length; i++) {
if(partySlots[i]) {
this.playerMinions[o] = PlayerCombatMinion(partySlots[i]);
o++;
}
}
this.currentPlayerMinion = this.playerMinions[0];
$.ajax({
url: "./api/generateEnemyCombatMinions.php",
cache: false
})
.done(function( html ) {
var response = html.split(":::");
for(var i …Run Code Online (Sandbox Code Playgroud) 我遇到了一个相当奇怪的问题,并且已经被困在这个问题上两天了。我有一个运行 nginx-ingress 和 cert-manager 的 kubernetes 集群。一切似乎都工作正常,但当通过 HTTPS 访问我的网站时,它给出以下错误(在 chromium Edge 中):
NET::ERR_CERT_AUTHORITY_INVALID
如果我继续,它会正常加载网站,但没有证书。
证书已正确给出,秘密已创建,任何地方都没有错误。
我的入口资源中有以下注释:
kubernetes.io/ingress.class: "nginx"
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: "letsencrypt-production"
ingress.kubernetes.io/ssl-redirect: "true"
Run Code Online (Sandbox Code Playgroud)
我的集群发行者:
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-production
spec:
acme:
# The ACME production api URL
server: https://acme-staging-v02.api.letsencrypt.org/directory
# Email address used for ACME registration
email: *********
# Name of a secret used to store the ACME account private key
privateKeySecretRef:
name: letsencrypt-production
# Enable the HTTP-01 challenge provider
solvers:
- http01:
ingress:
class: nginx
Run Code Online (Sandbox Code Playgroud)
证书资源返回: …
尝试访问路线时出现以下错误,但需要控制器来加载数据:
(1/1) InvalidArgumentException
Action Facade\Ignition\Http\Controllers\ShareReportController not defined.
Run Code Online (Sandbox Code Playgroud)
我正在使用 Tenancy/Multi-Tenant 包,并将其配置为使用 paths/tenants.php 专门为租户加载路由。如果我在租户.php 文件中执行以下操作,它将返回正确的响应。
Route::get('/test', function() {
return 'Test success';
});
Run Code Online (Sandbox Code Playgroud)
虽然当我尝试做同样的事情时,但从控制器加载数据,如下所示:
Route::get('/testt', 'TenantController@testt');
Run Code Online (Sandbox Code Playgroud)
它将显示错误:
(1/1) InvalidArgumentException
Action Facade\Ignition\Http\Controllers\ShareReportController not defined.
Run Code Online (Sandbox Code Playgroud)
如果我尝试将相同的代码放入 web.php 路由中,那么它可以完美运行。可能是什么问题呢?我的代码中有什么东西吗?可能是因为我使用的多租户包的原因吗?我将如何进一步调试这个?
在数据库中创建新租户时,我添加了一个用于验证数据的自定义请求类。出于某种原因,虽然我收到以下错误:
这是我的自定义请求类:Too few arguments to function App\\Http\\Requests\\CreateTenantRequest::Illuminate\\Foundation\\Providers\\{closure}(), 0 passed and exactly 1 expected在第 51 行,这是 message() 函数的右括号所在的位置
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class CreateTenantRequest extends FormRequest
{
/**
* 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()
{
$product_id = $this->get('product_id');
return [ …Run Code Online (Sandbox Code Playgroud) laravel ×2
arrays ×1
cert-manager ×1
eloquent ×1
javascript ×1
kubernetes ×1
laravel-6 ×1
multi-tenant ×1