Vuejs2 Laravel API调用在生产中失败
我目前正在从事VueJS+Laravel 6项目 在Localhost中一切正常,但在生产中,尽管web路由工作正常,但API调用失败 我在Apache日志和Laravel日志中没有错误 我是否遗漏了与Laravel passport相关的需要更新的内容 我简单地在生产中运行php artisan passport:install 这是我在Ubuntu服务器上安装的 我试着不安装fail2ban,但没用 这是我的虚拟主机Vuejs2 Laravel API调用在生产中失败,vuejs2,apache2,laravel-6,php-7.4,Vuejs2,Apache2,Laravel 6,Php 7.4,我目前正在从事VueJS+Laravel 6项目 在Localhost中一切正常,但在生产中,尽管web路由工作正常,但API调用失败 我在Apache日志和Laravel日志中没有错误 我是否遗漏了与Laravel passport相关的需要更新的内容 我简单地在生产中运行php artisan passport:install 这是我在Ubuntu服务器上安装的 我试着不安装fail2ban,但没用 这是我的虚拟主机 <VirtualHost *:80 *:443>
<VirtualHost *:80 *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/myproject/public
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/myproject>
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
这些是我运行的artisan命令
php artisan key:generate && php artisan migrate:fresh --seed && php artisan storage:link && php artisan passport:install && php artisan config:cache
嗯。。。我显然没能运行sudoa2enmod重写 把它放在这里以防万一,将来会对其他人有所帮助
chown -R www-data.www-data ./ && chmod -R 755 ./ && chmod -R 777 storage && chmod -R 777 bootstrap/cache/
php artisan key:generate && php artisan migrate:fresh --seed && php artisan storage:link && php artisan passport:install && php artisan config:cache