1,假设你要访问的项目名称为‘hms’

2,在Tomcat的webapps下创建hms文件夹,

3,配置config/index.js文件,设置assetsPublicPath: '/hms/'

    (解释:这里改为这个配置之后,最后编译产生的index.html中相关路径也会带上‘/hms’,不会报404的错误了)

4,在项目运行“npm run build:prod”命令,生成dist文件夹,dist文件夹中包含static和index.html

5,将dist文件夹中static和index.html复制到Tomcat中webapps的hms文件夹中

6,启动Tomcat,ip:port/hms,例如:http://localhost:8081/hms/即可访问到Vue项目。

相关文章:

  • 2022-01-08
  • 2021-10-01
  • 2021-08-21
  • 2021-08-07
  • 2021-11-18
  • 2021-06-30
  • 2021-10-02
猜你喜欢
  • 2021-05-24
  • 2021-08-18
  • 2021-12-31
  • 2021-08-23
  • 2021-06-04
  • 2021-10-16
  • 2021-11-28
相关资源
相似解决方案