为什么 axios get 方法请求发送两次?

Shr*_*shi 4 vue.js

在此处输入图片说明我运行 axios get 方法来调用 php 脚本。但是请求发送两次如何解决这个问题。我的功能:-

   axios.get('http://13.233.179.174/customers_log.php',{
                  headers: {
                    'Access-Control-Allow-Origin': '*'
                  },
                })
                  .then(function (response) {
                    $("#spinner").hide();
                    console.log('this is response work');
                    console.log(response.data);
                  })
                  .catch(function (error) {
                    $("#spinner").hide();
                    console.log(error);
                  })
Run Code Online (Sandbox Code Playgroud)

aro*_*ora 5

这是一个预检请求

它是一个 OPTIONS 请求,使用三个 HTTP 请求标头:Access-Control-Request-Method、Access-Control-Request-Headers 和 Origin 标头。

在这里查看 - https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request