When I first came into contact with the vue project, the project packaged the dist file. After being deployed to tomcat, the static image could not be found.

  • the project packages the dist file. After it is deployed to tomcat, it cannot be accessed. Change the"/"of assetsPublicPath to". /", the project can be accessed normally, but the picture always cannot be displayed
  • .
  • build parameters
// Template for index.html
    index: path.resolve(__dirname, "../dist/index.html"),
    // Paths
    assetsRoot: path.resolve(__dirname, "../dist"),
    assetsSubDirectory: "static",
    assetsPublicPath: "./",
  • Project structure

what is the reason why the picture hasn"t come out all the time?


Pack path question click on the console network to take a closer look at the path of report 404 must be different from what you think

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4532f-44b2b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4532f-44b2b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?