前端VUE+后端Springboot 项目搭建
网址:https://v3.cn.vuejs.org/guide/introduction.html#vue-js-是什么
vue.js
node下载:https://nodejs.org/zh-cn/
C:\Users\GW00240066\Desktop\springboot_vue>npm -v
6.14.14
C:\Users\GW00240066\Desktop\springboot_vue>node -v
v14.17.4
C:\Users\GW00240066\Desktop\springboot_vue>npm install -g @vue/cli
...
C:\Users\GW00240066\Desktop\springboot_vue>vue create vue_springboot_demo

![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-J8jbtmoR-1633678903917)(D:\notes\vue+springboot.assets\image-20210903095447450.png)]](https://img-blog.csdnimg.cn/a3db125c239e445ab1dba0060af3d20b.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAU3RkaW9fUVU=,size_20,color_FFFFFF,t_70,g_se,x_16)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Mm5LA8jA-1633678903918)(D:\notes\vue+springboot.assets\image-20210903095620852.png)]](https://img-blog.csdnimg.cn/a92c9aaf264548379a021b387fa59563.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAU3RkaW9fUVU=,size_20,color_FFFFFF,t_70,g_se,x_16)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-8jeYV32h-1633678903922)(D:\notes\vue+springboot.assets\image-20210903095721777.png)]](https://img-blog.csdnimg.cn/cd1013fdaecc4c4ca915ac280f35a395.png)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-GOEzN8Ul-1633678903923)(D:\notes\vue+springboot.assets\image-20210903095925875.png)]](https://img-blog.csdnimg.cn/cbce336a973c468fa02df3353a0d17bd.png)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Vi00s2TC-1633678903924)(D:\notes\vue+springboot.assets\image-20210903100013859.png)]](https://img-blog.csdnimg.cn/626ad9e88a8a4de8918262ec8dda3d0d.png)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-12Q1ktyT-1633678903926)(D:\notes\vue+springboot.assets\image-20210903100232994.png)]](https://img-blog.csdnimg.cn/e4032c52735d4d80920db9fa5ef65eee.png)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-darqcmed-1633678903926)(D:\notes\vue+springboot.assets\image-20210903100449904.png)]](https://img-blog.csdnimg.cn/c54c2b75b9d04e528f51480bea4e47b2.png)
Ctrl + c 关闭当前启动的项目。
App running at:
- Local: http://localhost:8080/
- Network: http://10.20.46.76:8080/
Note that the development build is not optimized.
To create a production build, run npm run build.
终止批处理操作吗(Y/N)? y
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Rjpazp2l-1633678903927)(D:\notes\vue+springboot.assets\image-20210903101406485.png)]](https://img-blog.csdnimg.cn/1c18513af35145eabcae077e195b389d.png)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-10Dqn2PP-1633678903927)(D:\notes\vue+springboot.assets\image-20210903101628500.png)]](https://img-blog.csdnimg.cn/61534c40956446db9aac5e2dfda98e49.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAU3RkaW9fUVU=,size_20,color_FFFFFF,t_70,g_se,x_16)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ZROj1EoI-1633678903927)(D:\notes\vue+springboot.assets\image-20210903101834722.png)]](https://img-blog.csdnimg.cn/38b7ddb7ef884be09ac29fbd8ca075e5.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAU3RkaW9fUVU=,size_20,color_FFFFFF,t_70,g_se,x_16)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ZjzLXosd-1633678903928)(D:\notes\vue+springboot.assets\image-20210903103246199.png)]](https://img-blog.csdnimg.cn/1e900d8febe9493c864e31138dd961cc.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAU3RkaW9fUVU=,size_20,color_FFFFFF,t_70,g_se,x_16)
安装Element-plus
//网址:https://element-plus.gitee.io/#/zh-CN/component/installation
$ npm install element-plus --save
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-vw3J6S1J-1633678903928)(D:\notes\vue+springboot.assets\image-20210903132059762.png)]](https://img-blog.csdnimg.cn/cde088efe9124ecb981718f07e006126.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAU3RkaW9fUVU=,size_20,color_FFFFFF,t_70,g_se,x_16)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-Kic9paz5-1633678903929)(D:\notes\vue+springboot.assets\image-20210904142134025.png)]](https://img-blog.csdnimg.cn/b141e63498734313b5c4032cfb75b8cc.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAU3RkaW9fUVU=,size_20,color_FFFFFF,t_70,g_se,x_16)
阿里云的springboot搭建网站:
https://start.aliyun.com
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-MhAv1EUJ-1633678903930)(D:\notes\vue+springboot.assets\image-20210904144339742.png)]](https://img-blog.csdnimg.cn/24554196c2734575bb963b7a7a823f8e.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAU3RkaW9fUVU=,size_10,color_FFFFFF,t_70,g_se,x_16)
上图为搭建项目时所选择的依赖。
下图为项目结构:前端vue,后端springboot
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-x5mPHlg5-1633678903930)(D:\notes\vue+springboot.assets\image-20210904150735052.png)]](https://img-blog.csdnimg.cn/7a942b8f9b5a4c39af92da8e867d6267.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAU3RkaW9fUVU=,size_20,color_FFFFFF,t_70,g_se,x_16)
搭建数据库表
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-lXPWy5Ep-1633678903930)(D:\notes\vue+springboot.assets\image-20210904151441354.png)]](https://img-blog.csdnimg.cn/ae999559d0d7439289634fb9844beecd.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAU3RkaW9fUVU=,size_20,color_FFFFFF,t_70,g_se,x_16)
启动时出现程序包不存在的错误,要将如图所示选项勾上
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-1aLenKm4-1633678903931)(D:\notes\vue+springboot.assets\image-20210904152832412.png)]](https://img-blog.csdnimg.cn/3b24ce0714d848098ec8077863837a26.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAU3RkaW9fUVU=,size_20,color_FFFFFF,t_70,g_se,x_16)
Mybatis - plus :官网:https://mp.baomidou.com/
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.3.1</version>
</dependency>
自定义Result 函数返回方法。
package com.example.demo.common;
public class Result<T> {
private String code ;
private String msg ;
private T data ;
public String getCode() { return code ; }
public void setCode(String code) { this.code = code ; }
public String getMsg() { return msg; }
public void setMsg(String msg) { this.msg = msg; }
public T getData() { return data; }
public void setData(T data) { this.data = data; }
public Result(){
}
public Result(T data) { this.data = data ; }
public static Result success() {
Result result = new Result<>();
result.setCode("0");
result.setMsg("成功");
return result;
}
public static <T> Result<T> success(T data){
Result result = new Result<>();
result.setCode("0");
result.setMsg("成功");
return result;
}
public static Result error(String code , String msg){
Result result = new Result();
result.setCode(code);
result.setMsg(msg);
return result;
}
}

https://blog.csdn.net/xqnode/article/details/118325868
Vue项目搭建常用的配置文件,request.js和vue.config.js
工具类:https://www.hutool.cn/
chrom添加JSON格式:https://www.cnblogs.com/xifenglou/p/11364426.html
选中文件: shift +F6 改名
断点模式,F8跳转
BigDecimal Decimal
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date date;
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-8EY9p4xB-1633678903932)(D:\notes\vue+springboot.assets\image-20210910092504941.png)]](https://img-blog.csdnimg.cn/01475e6d65fb44dbaf430fa61a932107.png)
add as maven project
富文本编辑器:https://www.wangeditor.com/
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-i8IWckqo-1633678903933)(D:\notes\vue+springboot.assets\image-20210910093927061.png)]](https://img-blog.csdnimg.cn/7ef744ddcc5d48f7a1cf9c1652023d54.png)

浙公网安备 33010602011771号