【发布时间】:2021-06-21 14:44:18
【问题描述】:
所有 ajax 请求都因 403 Forbidden 错误而失败。是不是因为htaccess。我在服务器上托管它后遇到了这个问题。我已更改 .htaccess 如下。
<IfModule mod_rewrite.c>
AddHandler application/x-httpd-php72 .php
RewriteEngine On
# Removes index.php from ExpressionEngine URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]
</IfModule>
我在 public_html 和根目录的其他文件夹中有公共文件。
我在路径 API\MyContorller 和路径中有文件
Route::apiResources(['post' => 'API\MyContorller ]);
我遇到了 XHR 请求的问题,即 Ajax Call Put 请求
我正在调用update方法更新vue组件中的表格
updateQuiz(){
this.form.put('/api/chapter/'+this.$route.params.id + '/quiz/' + this.form.id);
}
【问题讨论】:
-
检查this是否有帮助?