0

我的后端和前端是完全分开的。一个使用 Laravel 5.3,另一个使用 VueJS 2。

我的前端不需要验证用户(公共网站)。但是,我的后端应该能够识别出 API 调用是从我的前端发送的,而不是从其他客户端/前端发送的。

我知道如何手动执行此操作,但我想知道是否可以使用 Dingo 包开箱即用地执行此操作,并且主机名或任何 API 调用被批准的方式不能被其他人欺骗?

4

1 回答 1

0

You can add a custom element, like the csrf_field(), to all of your forms. If you have that element...then it's coming from you.

edit: Or json web tokens, but that's a bit more work.

于 2016-10-12T04:21:25.780 回答