Axios cross-domain problem

problem description

react project, the front and rear ends are separated, and the axios API requests to implement cross-domain access interfaces;
ip: http://39.105.88.32:9200
interface address: api-auth/oauth/token
and successfully called in postman
clipboard.png

//
webpack
clipboard.png
.]


clipboard.png


clipboard.png

Apr.06,2022

your interface starts with / api-auth , so proxy can write:

proxy: {
    '/api-auth': {
        target: 'http://39.105.88.32:9200'
    },
    changeOrigin: true
}
Menu