There is a cross-domain problem when VUE.JS deploys axios requests to Tomcat.

problem description

I need to call the external WADL provided by the vendor in VUE (which should be the, POST) address of the JEREY framework. Locally, through the proxyTable configuration under config/index.js, I can run and call the interface successfully.

now you need to deploy to the tomcat of the server, but keep reporting to XMLHttpRequest cannot load http://:7001/getuser. No "Access-Control-Allow-Origin" header is present on the requested resource. Origin" http://:8009" is therefore not allowed access. Online posts can not pass (web.xml filter configuration, JSONP, QS).

now I can only modify the configuration of tomcat. The API http header, and the backend are not modified. How can I do that? Please give us some advice

the environmental background of the problems and what methods you have tried

clipboard.png

clipboard.png

clipboard.png

related codes

/ / Please paste the code text below (do not replace the code with pictures)
axios.post (process.env.API_HOST +"/ * ser", {/ /

)
      TYPE: "V",
      USER_NAME: this.username
    }).then(function (response, headers) {
        if (response.status === 200) {
          if (response.data.l_RET_STATUS == "Y") {
            window.sessionStorage.userName = self.username;
            this.showupError = false;
            this.$router.push("/home");
          } else {
            this.showupError = true;
          }
        } else {
          alert("")
        }
      }
    ).catch(function (error) {
      alert("")
    });

what result do you expect? What is the error message actually seen?

Menu