Due to the confidentiality of the project, the address of the ajax request interface needs to be hidden. How do you do it?
怪我咯2017-07-05 10:49:58
It feels like a request made by someone who is completely ignorant of technology... There will be no display without ajax request, just pure back-end rendering
typecho2017-07-05 10:49:58
ajax request is also an http request
As long as it is an HTTP request, you can see the request address, parameters and response by capturing the packet
学习ing2017-07-05 10:49:58
First, there is no need for ajax to render data in the background
Second, using ajax to use an intermediate interface to only return the data required by the front-end
It is impossible to expose the payment interface of our project to the front-end. It is the combination of these two methods
过去多啦不再A梦2017-07-05 10:49:58
Cannot be hidden
//You can use the backend to determine whether the connection source is legal. If it is not legal, close the connection
// $_SERVER['HTTP_ORIGIN'] identifies which site the page request comes from
if($_SERVER['HTTP_ORIGIN'] != 'http://www.baidu.com')
{
die();
}
PHP中文网2017-07-05 10:49:58
Change the idea, the browser cannot hide it, the browser exposes the API, there is no such API