SpringBoot+Mybatis-plus与vue前后端集成

本文介绍了SpringBoot+Mybatis-plus与Vue进行前后端集成的步骤,包括SpringBoot项目的创建,Mybatis-plus、Druid、MySQL的配置,RESTful API设计规范的应用,以及Vue框架下登录处理和跨域问题的解决方案。
摘要由CSDN通过智能技术生成

一、知识准备

1.springboot
springboot简化了配置编写,可以快速开发web应用,已经成为java主流的开发框架。
2.vue
前端开发也进入框架时代,vue能够满足前后端开发分离的需要,快速独立构建前端应用。
3.mybatis-plus
mybatis-plus是对mybatis的扩展,在保留了mybatis灵活使用sql语句的基础上,又扩展了基本的CRUD功能调用,大大提高了开发效率,程序员不用在编写、调试基本的CRUD映射sql语句。
4.json
前后端分离后,采用json格式作为前后端数据交互标准。
5.Restful API设计规范
RESTFUL是一种网络应用程序的设计风格和开发方式,客户端使用GET、POST、PUT、DELETE4个表示操作方式的动词对服务端资源进行操作:GET用来获取资源,POST用来新建资源(也可以用于更新资源),PUT用来更新资源,DELETE用来删除资源。

二、前后端集成

1、使用Maven创建springboot项目
2、引入pom配置,添加mybatis-plus、druid、mysql依赖

<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-devtools</artifactId>
			<optional>true</optional>
		</dependency>
		<!-- Mysql-Connector -->
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
		</dependency>

		<!-- Fastjson -->
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>fastjson</artifactId>
		</dependency>
		<!-- Druid -->
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>druid-spring-boot-starter</artifactId>
		</dependency>
		<!-- Mybatis-plus -->
		<dependency>
			<groupId>com.baomidou</groupId>
			<artifactId>mybatis-plus-boot-starter</artifactId>
		</dependency>
		<!-- Pagehelper -->
		<dependency>
			<groupId>com.github.pagehelper</groupId>
			<artifactId>pagehelper-spring-boot-starter</artifactId>
		</dependency>
		
		<dependency>
			<gro
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值