maven+vue+springboot

运行maven + vue + springboot项目

运行步骤-后端篇

  1. 在pol.xml文件中 右键 点击 Add as a maven project

  2. 配置Maven

  3. 添加database

  1. 输入用户名和密码 ,test connection
  1. 新建数据库vuesbag
  1. 选择新建的数据库
  1. 执行sql文件 初始化数据库
  1. 点击Run mysql.sql之后选择新建的数据库
  1. run完之后会发现数据库已被初始化,生成了很多表
  1. 修改src/main/resources/application.yml文件

如图:

  1. 右上角运行启动类
  1. 运行之后发现报错:
1
2
3
Sun Nov 13 11:25:54 CST 2022 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2022-11-13 11:25:55.010 ERROR 17660 --- [eate-1886236609] com.alibaba.druid.pool.DruidDataSource : create connection SQLException, url: jdbc:mysql://localhost:3306/vuesbag?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8, errorCode 0, state 08S01

解决方法:在url最后加上useSSL=false

  1. 最后后端成功运行

运行步骤-前端篇

  1. 进入前端文件夹npm install

报错1

Error: Can‘t find Python executable “python“, you can set the PYTHON env variable

cmd管理员运行

npm install --global --production windows-build-tools


报错2

npm run dev之后报错按照这个install一下就行

报错3

Error: Cannot find module 'node-sass'

cnpm install node-sass@latest

ps

最后如果npm run dev还报错,则再npm install一下就好了。


运行成功截图