PHP solves the problem of cross-domain access

Put the following code in the first line of the controller to solve

header('Access-Control-Allow-Origin: http://ding.taozugong.com');
header('Access-Control-Allow-Methods: POST, GET, DELETE, PUT, PATCH, OPTIONS');
header('Access-Control-Allow-Headers: token, Content-Type');
header('Access-Control-Allow-Credentials: true');

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325877984&siteId=291194637