繁体   English   中英

Artisan提供的所有功能都可以完美运行,但是当我在Xampp上运行它时,某些功能不起作用

[英]Artisan serve all functions works perfectly, but when I run it on Xampp some functions doesnt work

嗨,大家好,我的网络应用程序有问题,在PC上进行开发时,我正在使用php arstisan serve命令,但是当我在Xampp上运行网络应用程序,然后将手机连接至IP地址时,我可以在那里使用网络应用程序。 页面加载并且提交了一些表单,但是其他表单却不能在我的127.0.0.1:8000(这是laravel的开发URL)上都能正常工作,这是由于我正在使用Vue axios发布到所有我的表格

错误代码为:405方法不允许。

“试图获取非对象的属性'id'(视图:C:\\ xampp \\ htdocs \\ projects \\ Centralsocial \\ resources \\ views \\ User \\ feedbackpage.blade.php)”

我认为该代码中的错误:

<div id="app">
    <survey-component :user_id="<?php echo e(Auth::user()->id); ?>"></survey-component>
</div>

对于遇到此问题的人,这是我解决的方法

Vue Axios开机自检

axios.post('/api/surveysubmit/' +this.user_id,{
q1: this.selected.q1,
q2: this.selected.q2,

我在Api中添加了“ + this.user_id”

API.PHP

//  user submit survey
Route::post('surveysubmit/{user_id}', 'StudentController@surveysubmit');

我不知道这是否是最好的方法,但是嘿,它对我有效:)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM