【发布时间】:2017-12-19 08:56:41
【问题描述】:
我尝试了一篇带有多个变量的 axios 帖子。但我不能。 Register.vue 发布用户名、名字和姓氏。一项成功发送,因为树项无法发送。我将数据从“register.vue”发送到“routes.php”。我正在搜索这个但找不到。人们只说“register.vue”,没有人不说routes.php。
register.vue:
axios.post(`http://localhost:8000/register`,
params:{
un=this.un,
fn=this.fn,
ln=this.ln
})
.then(function(response){
console.log("data------");
console.log(response.data);
console.log("data-------");
});
routes.php:
Route::post('register',function(Request $un,Request $fn,Request $ln)
{
$redis=Redis::connection();
$un=$un->input();
$fn=$fn->input();
$ln=$ln->input();
reset($un,$fn,$ln);
$tobe=$redis->exists("$un:$fn:$ln");
return $tobe;
});
【问题讨论】:
-
你能出示你的代码吗
-
请参阅 How to Ask 和 minimal reproducible example 以帮助您入门
-
感谢您的关注。我更新了。