The problem

In my work, I encountered a bug of multiple parameters in the request interface. The interface address we want to request is as follows: xxx.fff.net/ivradmin/iv… Here ‘/ webadmin is, in fact, we don’t want, to axios transfer request address is ivradmin/aaa/form/customer/query, we haven’t add axios path’/wenadmin ‘, but when we send the request, ‘/webadmin’ is automatically loaded with the wrong interface: xxx.fff.net/webadmin/iv… (Current page address xxx.fff.net/webadmin/#/… This is the equivalent of the first level of the domain name spliced together.

To solve

Then change the path of the request to the/ivradmin ivrproject/form/customer/query (that is, the front with a slash /), / webadmin is no stitching on again. This is because if we do not add /, the address will be used as a relative address to find the path, so we add/to the current domain /webadmin directory, and/to find the path as an absolute path, which will directly join the domain, rather than the relative path /wenadmin under the domain.

conclusion

The difference between a relative path and an absolute path is whether or not a ‘/’ is added