当前位置: 首页 > news >正文

vue3 整合 springboot 打完整jar包

前端

  • .env.developmen
VITE_APP_BASE_URL='/api'
  • .env.production
VITE_APP_BASE_URL='/'

axios 配置

axios.defaults.baseURL = import.meta.env.VITE_APP_BASE_URL

package.json

"scripts": {"dev": "vite --mode development","build": "vite build --mode production"}

vite.config.js

 server: {port: 4000, //设置服务启动端口号,是一个可选项,不要设置为本机的端口号,可能会发生冲突open: true, //是否自动打开浏览器,可选项cors: true, //允许跨域。// 设置代理proxy: {'/api': {target: 'http://localhost:8053/', //这是你要跨域请求的地址前缀changeOrigin: true, //开启跨域rewrite: (path) => path.replace(/^\/api/, '')}}}

后端

pom.xml

            <plugin><groupId>org.codehaus.mojo</groupId><artifactId>exec-maven-plugin</artifactId><version>1.6.0</version><executions><execution><id>exec-pnpm-install</id><phase>validate</phase><goals><goal>exec</goal></goals><configuration><executable>pnpm</executable><arguments><argument>install</argument></arguments><workingDirectory>${basedir}/src/ui</workingDirectory></configuration></execution><execution><id>exec-pnpm-run-build</id><phase>validate</phase><goals><goal>exec</goal></goals><configuration><executable>pnpm</executable><arguments><argument>build</argument></arguments><workingDirectory>${basedir}/src/ui</workingDirectory></configuration></execution></executions></plugin>
http://www.lryc.cn/news/167041.html

相关文章:

  • 依赖倒转原则是什么?
  • 什么是GPT与MBR
  • 前后端开发接口联调对接参数
  • 定时任务框架-xxljob
  • idea项目配置三大步
  • 学会SpringMVC之自定义注解各种场景应用,提高开发效率及代码质量
  • 步态识别常见模块解读及代码实现:基于OpenGait框架
  • 前端八股文之“闭包”
  • 数据可视化:掌握数据领域的万金油技能
  • Apache Kafka 基于 S3 的数据导出、导入、备份、还原、迁移方案
  • 事务管理AOP
  • Java从Tif中抽取最大的那张图进行裁剪成x*y份
  • 人工智能AI界的龙头企业,炸裂的“英伟达”时代能走多远
  • 【实战】H5 页面同时适配 PC 移动端 —— 旋转横屏
  • 使用凌鲨进行聚合搜索
  • 程序设计之——手把手教你如何从Excel文件中读取学生信息
  • Docker容器化技术(从零学会Docker)
  • 【新版】系统架构设计师 - 案例分析 - 总览
  • 【Git】02-Git常见应用
  • YOLO物体检测-系列教程2:YOLOV2整体解读
  • u盘传输数据的时候拔出会怎么样?小心这些危害
  • 【踩坑纪实】URL 特殊字符 400 异常
  • Contents:帮助公司为营销目的创建内容
  • 1397: 图的遍历——广度优先搜索
  • Java 华为真题-选修课
  • Invalid access token: Invalid header string: ‘utf-8‘ codec can‘t decode byte
  • Java 中将多个 PDF 文件合并为一个 PDF
  • python经典百题之水仙花数
  • jvm的调优工具
  • C语言--字符串旋转笔试题