How should vuejs be set up for cross-domain packaging?

Cross-domain request path error occurred after packaging

clipboard.png
where should I set the path?
config/index Code:
dev: {

// Paths
assetsSubDirectory: "static",
assetsPublicPath: "./",
proxyTable: {
  "/api":{
  target:"https://www.qqbsmall.com",
  changeOrigin:true,
  pathRewrite:{
    "^/api":""
  }
}},


build: {
// Template for index.html
index: path.resolve(__dirname, "../dist/index.html"),

// Paths
assetsRoot: path.resolve(__dirname, "../dist"),
assetsSubDirectory: "static",
assetsPublicPath: "./",


  
Feb.26,2021

the cross-domain after launch is left to the server (setting cors or proxy). At the time of development, a local node service has been set up to act as your agent.


when you develop, you use the proxy in the dev environment. When you package it, you need to put it in the service environment, that is, the web server corresponding to the target. Double-clicking the html file directly is not allowed

.
Menu