Why is the entire PHP code returned when accessing PHP files under webpack, but it can be accessed normally in a normal environment.
< /p>
走同样的路,发现不同的人生
Webpack is an independent server environment and does not support parsing php. Just write a json file request for simulated data, or you can run php on the Apache server to turn off cross-domain restrictions and then request again
You opened this PHP as a file.
You did not set the return format
header('content-type:application/json;charset=utf8'); ...... echo (json_encode(success))
What "success" should be returned?But who is responsible for parsing php?
Webpack is an independent server environment and does not support parsing php. Just write a json file request for simulated data, or you can run php on the Apache server to turn off cross-domain restrictions and then request again
You opened this PHP as a file.
You did not set the return format
What "success" should be returned?
But who is responsible for parsing php?