There are many ways to request, such as get post put get, also called queryParams, so the request sent with parameters is spelled like this.
You can spell' page ='+page+'&; Size =' size this way of writing, but this way of writing is too rigid, when the background requires you to wear valuable parameters, you will pass them when they are not there, so it is impossible, because even if there is no data in the collected form, you will pass a key in the past, so you will receive a null value in the background. At this time, can you get the request in another way? Params, this writing is more flexible and easy to write, like this.
But when you are asked to be worthless, don't pass it on. What else do you have to do? For example, put all the data to be transmitted in an object, and the object will process it before sending a request to delete the unworthy attributes, such as this one.
There is also the problem of sending requests, because there will be cross-domain problems during development. We usually configure a proxyTable for convenience, but after packaging and deployment, there will be problems on the server because there is no cross-domain request address on the server, but as I said in my last post? It was troublesome to change the request address to the server address before each package, so I did it.
I configured something like this in config/dev.en.js
This is configured in config/prod.env.js
Write this code when making a request in a component.
I think this is still useful. If there is a problem, you need to check the request address in the debugging tool's network to see if it is correct. If it is not correct, change it.
These are all relatively basic, but very practical, I hope I can help you.