what should I do when the vue axios request backend is set to allow cross-domain get requests and becomes options requests?
:
what should I do when the vue axios request backend is set to allow cross-domain get requests and becomes options requests?
:
first learn what an options request is and why there is an options request. This is a request that usually occurs when you set Cors for cross-domain operations, and it is a normal request.
this is a normal operation, and you don't need to solve it. You just need to care about whether the data has been requested.
the request header of the backend is not complete.
if I remember correctly, content-type is also added, can't you add it?
options operation is to say hello first, the basic operation is ignored, and the general framework will handle it.
update:
options request to communicate with browser to allow custom header,. There is no from, in your return. You have customized the contenttype, to be added to the post request.
add a @ CrossOrigin annotation to the backend method, which seems to be the content after spring4.2, to solve cross-domain problems
.Previous: Why doesn't the browser debugger prevent the browser from rendering the interface while alert can?
how can the data looped out by vue change color to the current one when clicked? this is what my page says <ol v-if="tooglezhi" class="ol_one"> <li v-for="(item,key) in arr" ...
the number of digits in the input box is controlled. When this value echoes the maximum number of digits, the input can only be deleted and the input cannot be overridden directly. who knows what attributes the input has to control this ...
Baidu didn t find the reason for it for a while-the error message thrown by the browser was Uncaught Error: Objects are not valid as a React child (found: object with keys {}). If you meant to render a collection of children, use an array instead or wr...
shouldn t vue use vue-router? Why can it only be put into devDependencies (development dependency)? ...
I used Wechat developer tool to debug the official account of the web page, but suddenly the page did not display, there was nothing in div-sharpapp, there were all those routes, and other colleagues could run this project, but I couldn t. It was a blan...
...
the demand is like this, the left menu bar, the right content area, click a button to load an iframe page, click the next to load another iframe page, how to achieve? I don t know much about iframe pages, thank you! ...
<image>< image>< svg> <script> const aa = document.getElementById( aa ) const bb = document.createElement( svg ) bb.innerHTML = aa.innerHTML bb"<img>""<image>< imag...
1. Today, when I maintained the old code of the company, I saw some of the old code. The purpose of this code is to load the html template. index.htmljs $( div ).load( templateOfchart.html ); templateOfchart.html content in 2.templateOfchar...
as shown in figure I really can t find it. Ask for help ...
$this.printAsset = function () { var selectedIds = selectedAssetIds(); if (selectedIds.length == 0) { bootAlert( ); return false; } window.location.href = Asset Print?ids= + selectedAssetIds(); }; A snippet of c...
I d like to ask the bosses that if you want to use hbuilder to develop hybrid app, that has written ajax requests, you can request the obtained data in the local server environment. But after packaging, if you test it on the phone, you can t get the da...
if the div from v-for in vue shows that div1 has a div3, condition, it first shows that div3, will be squeezed out of div3 when the next condition is set up for div1 display. How to solve this problem? the code for my loop is <div class=&q...
<a href="xx">< a> ...
how does 1.ECharts increase the chart according to the data? for example, if I have two pieces of data here, how can I add two gauges? 2. This is the code, you need to use c3text and c4text to set the scale of the dashboard: ] [1] 3. This is the cod...
after my page loads, there will be a sort number. when I double-click the current row, the sort number will become editable and will be saved after losing focus. what do I do? I can get the id, of the current line, but how to edit the current line....
base64: var str_base64 = "CgkJCgkJCQk8Y29uZGl0aW9ucyB0eXBlPSJBTkQiPgoJCQkJCTxzeXNDb25kaXRpb25zIHR5cGU9Inx8Ij4KCQkJCQk8c3lzQ29uZGl0aW9uIG5hbWU9ItDCzsS1tSIgZXhwcmVzc2lvbj0iS0dselRtVjNSRzlqS0NrcElBPT0iLz4KCQkJCQk8c3lzQ29uZGl0aW9uIG5hbWU9IrWxx7C0psDtyMs...
I created a table table, and the expected effect is that when the mouse moves over each table cell th, the background color automatically turns white and an audio is played. The problem with now is that the background color of the cell has been success...
exif.js:380 XMLHttpRequest cannot load file: C: Users pjy Desktop exif-js exif-js-master example dsc_09827.jpg. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https. ...
when the first picture is normal, then click on the left column to put away the rotation picture can not immediately adapt to the screen to appear a blank the strangest thing is that as soon as I press F12 to view the elements, it can be self-adap...