Browse Source

接口跨域允许

master
wanghongjun 3 years ago
parent
commit
aea1565fe5
  1. 6
      source/application/api/controller/Controller.php

6
source/application/api/controller/Controller.php

@ -26,8 +26,10 @@ class Controller extends \think\Controller
*/ */
public function _initialize() public function _initialize()
{ {
header('Access-Control-Allow-Origin: http://192.168.66.220:8080'); header("Access-Control-Allow-Origin: http://192.168.66.220:8080");
header('Access-Control-Allow-Credentials: true'); header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE");
header("Access-Control-Allow-Headers: Content-Type");
header("Access-Control-Allow-Credentials: true");
// 当前小程序id // 当前小程序id
// $this->wxapp_id = $this->getWxappId(); // $this->wxapp_id = $this->getWxappId();
// // 验证当前小程序状态 // // 验证当前小程序状态

Loading…
Cancel
Save