• SpringBoot+MybatisPlus Restful示例


    增删改查,分页

    CREATE TABLE `tbl_book` (
      `id` int NOT NULL AUTO_INCREMENT,
      `type` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
      `name` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
      `desc_ription` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
      `sensitive_Info` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
      `sensitive_Info2` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
      `create_time` datetime DEFAULT NULL,
      `update_time` datetime DEFAULT NULL,
      PRIMARY KEY (`id`) USING BTREE
    ) ENGINE=InnoDB AUTO_INCREMENT=85 DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC;

    INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (74, '图林原创', 'Nginx经典教程', 'F5 NGINX核心人员倾力打造,关注基础用法和现代场景,新技术趋势下经典全新解读,涵盖容器,Kubernetes,NJS语言,新协议支持等', NULL, NULL, '2023-11-10 21:12:07', NULL);
    INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (75, '全栈开发', 'Vue.Js前端开发基础与项目实战', '系统深入从原理进行分析,详细介绍前端的发展和常用Vue.js功能模块,内容实用,全面讲解Vue.js生态链且涵盖后端架构相关知识,项目实战详细介绍实用插件和构建PC端网站的步骤及前后端开发流程', NULL, NULL, '2023-11-10 21:14:49', NULL);
    INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (76, '架构', '凤凰架构', '从架构演进,架构设计思维,分布式基石,不可变基础设施,技术方法论5个维度全面探索如何构建可靠的大型分布式系统', NULL, NULL, '2023-11-10 21:16:38', NULL);
    INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (77, '华章科技', 'Maven实战', '国内首本Maven著作,内容全面,实战性强,公认的Maven专家执笔,中外技术专家联合推荐,权威性无需置疑', NULL, NULL, '2023-11-10 21:18:31', NULL);
    INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (78, 'Broadview', '深入理解Apache Dubbo与实战', NULL, NULL, NULL, '2023-11-10 21:19:46', NULL);
    INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (79, '图林程序设计丛书', 'SQL查询', '赢得世界赞誉的SQL经典著作', NULL, NULL, '2023-11-10 21:20:27', NULL);
    INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (80, '华章科技', '分布式中间件技术实战', NULL, NULL, NULL, '2023-11-10 21:21:31', NULL);
    INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (81, '异步图书', 'SpringBoot源码解读与原理分析', NULL, NULL, NULL, '2023-11-10 21:22:09', NULL);
    INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (82, '图林程序', 'SQL必知必会', '畅销全球的数据库入门经典', NULL, NULL, '2023-11-10 21:23:03', NULL);
    INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (83, 'Java专家系列', 'JDBC数据库程序设计', '本书讨论的内容主要是如何利用Java程序语言,编写与数据库相关的应用程序.从最开始Java语言与数据库管理系统的介绍,JDBC API的实用,乃至最后Java数据库应用程序开发的实战.都将在本书中详细说明.详细的实例讲解和完整的章节安排,非常适合Java初学者快速学习实用Java开发数据库相关的应用程序,范例程序丰富,代码和运行结果以图文并茂的方式配合呈现', NULL, NULL, '2023-11-10 21:26:50', NULL);
    INSERT INTO `tbl_book`(`id`, `type`, `name`, `desc_ription`, `sensitive_Info`, `sensitive_Info2`, `create_time`, `update_time`) VALUES (84, 'GOTOP', '鸟哥的Linux私房菜', '经久不衰的Linux经典教程', NULL, NULL, '2023-11-10 21:27:45', NULL);

    pom.xml

    
    
        4.0.0
        
            org.springframework.boot
            spring-boot-starter-parent
            2.7.2
             
        
        com.example
        ssmp
        0.0.1-SNAPSHOT
        ssmp
        Demo project for Spring Boot
        
            17
        
        
            
                org.springframework.boot
                spring-boot-starter-web
            
            
                com.baomidou
                mybatis-plus-boot-starter
                3.4.3
            
            
                com.alibaba
                druid-spring-boot-starter
                1.2.16
            
            
                mysql
                mysql-connector-java
                runtime
            
            
                org.projectlombok
                lombok
                true
            
            
                org.springframework.boot
                spring-boot-starter-test
                test
            
        
    
        
            
                
                    org.springframework.boot
                    spring-boot-maven-plugin
                    
                        
                            
                                org.projectlombok
                                lombok
                            
                        
                    
                
            
        
    
    
    

    application.properties

    实体类

    package com.example.ssmp.pojo;
    
    import com.baomidou.mybatisplus.annotation.*;
    import lombok.AllArgsConstructor;
    import lombok.Data;
    import lombok.NoArgsConstructor;
    import lombok.Value;
    import lombok.experimental.Accessors;
    
    import java.util.Date;
    
    /**
     * @author hrui
     * @date 2023/11/10 0:34
     */
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Accessors(chain = true)
    //@TableName("tbl_book")  已全局配置
    public class Book {
        //标识id为表的主键
        //value为id的名称(和表字段一样可以不写)  type为主键自增情况
        //auto为数据库自增
        //ASSIGN_UUID 通过uuid进行主键的自增
        //@TableId(value = "id",type=IdType.AUTO)    已全局配置
        private String id;
        private String type;
        private String name;
        private String descRiption;
        //insert的时候触发的时候自动填充
        @TableField(fill = FieldFill.INSERT)
        private Date createTime;
        //update触发的时候自动填充
        @TableField(fill = FieldFill.UPDATE)
        private Date updateTime;
    
    //    @TableField(select = true, insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
    //    private String sensitiveInfo; // 只在查询中展示
    //
    //    private transient String sensitiveInfo2;
    
    }

    DAO层

    业务层

    实现类

    控制器

    package com.example.ssmp.controller;
    
    
    import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
    import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
    import com.baomidou.mybatisplus.core.metadata.IPage;
    import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
    import com.example.ssmp.pojo.Book;
    import com.example.ssmp.service.BookService;
    import com.fasterxml.jackson.databind.ObjectMapper;
    import org.apache.logging.log4j.util.Strings;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.web.bind.annotation.*;
    
    import java.util.List;
    
    
    /**
     * @author hrui
     * @date 2023/11/10 0:42
     */
    @RestController
    @RequestMapping("/books")
    public class BookController {
    
        @Autowired
        private BookService bookService;
    
        @GetMapping
        public R getAllBooks(){
            return new R(true, bookService.list());
        }
        @GetMapping("/{pageNum}/{pageSize}")
        public R getAllBooks(@PathVariable Integer pageNum,@PathVariable Integer pageSize,Book book){
    
            Page page=new Page<>(pageNum,pageSize);
            LambdaQueryWrapper lambdaQueryWrapper=new LambdaQueryWrapper<>();
    
            lambdaQueryWrapper.like(Strings.isNotEmpty(book.getName()), Book::getName, book.getName());
            lambdaQueryWrapper.like(Strings.isNotEmpty(book.getType()), Book::getType, book.getType());
            lambdaQueryWrapper.like(Strings.isNotEmpty(book.getDescRiption()), Book::getDescRiption, book.getDescRiption());
            page = bookService.page(page,lambdaQueryWrapper);
            /**
             * 存在情况
             * 比如第三页只有一条数据,删除后getAll,传过来的页面是3  但是返回的是无数据
             */
            if(pageNum>page.getPages()){
                //重查一遍
                page=new Page<>(page.getPages(),pageSize);
                page=bookService.page(page,lambdaQueryWrapper);
            }
            return new R(true, page);
        }
    
        @GetMapping("/{id}")
        public R getById(@PathVariable String id){
            Book book = bookService.getById(id);
            return new R(book!=null, book,book!=null?"成功":"数据同步失败,自动刷新");
        }
    
        @PostMapping
        public R save(@RequestBody Book book){
            System.out.println(123);
            boolean save = bookService.save(book);
            R r = new R(save);
            return r;
        }
    
    //    @PutMapping
    //    public Object update(@RequestBody Book book){
    //        return bookService.updateById(book);
    //    }
    
        @PutMapping
        public R update(@RequestBody List books){//用Book[]也可以  数据格式:[{},{}]
            boolean b = bookService.updateBatchById(books);
            return new R(b,b?"更新成功":"数据同步失败,自动刷新");
        }
    
    //    @DeleteMapping("/{id}")
    //    public Object delete(@PathVariable String id){
    //        return bookService.removeById(id);
    //    }
    
        @DeleteMapping("/{ids}")//http://localhost:8080/books/52,53
        public R delete(@PathVariable List ids){
            boolean b = bookService.removeByIds(ids);
            return new R(b,b?"删除成功":"数据同步失败,自动刷新");
        }
    }

    统一返回

    package com.example.ssmp.controller;
    
    import lombok.AllArgsConstructor;
    import lombok.Data;
    import lombok.NoArgsConstructor;
    import lombok.experimental.Accessors;
    
    /**
     * @author hrui
     * @date 2023/11/10 7:03
     */
    @NoArgsConstructor
    @AllArgsConstructor
    @Data
    @Accessors(chain = true)
    public class R {
        private Boolean flag;//表示调用是否成功
        private Object data;
        private String msg;
    
        public R(Boolean flag){
            this.flag=flag;
        }
    
        public R(String msg){
            this.flag=false;
            this.msg=msg;
        }
    
        public R(Boolean flag,Object data){
            this.flag=flag;
            this.data=data;
        }
    
        public R(Boolean flag,String msg){
            this.flag=flag;
            this.msg=msg;
        }
    }

    全局异常处理

    package com.example.ssmp.exception;
    
    import com.example.ssmp.controller.R;
    import lombok.extern.slf4j.Slf4j;
    import org.springframework.web.bind.annotation.ExceptionHandler;
    import org.springframework.web.bind.annotation.RestControllerAdvice;
    
    /**
     * @author hrui
     * @date 2023/11/10 10:39
     */
    @RestControllerAdvice
    @Slf4j
    public class PExceptionAdvice {
    
        //private static final Logger log= LoggerFactory.getLogger(PExceptionAdvice.class);
    
        @ExceptionHandler(Exception.class)
        public R doException(Exception e){
            //记录日志
            log.error("exception", e);
    
            e.printStackTrace();
            return new R("服务器故障,稍后再试");
        }
    }
    

     MybatisPlus 自动填充配置

    package com.example.ssmp.congif;
    
    import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
    import org.apache.ibatis.reflection.MetaObject;
    import org.springframework.stereotype.Component;
    
    import java.util.Date;
    
    /**
     * @author hrui
     * @date 2023/11/10 3:14
     */
    @Component
    public class DateHandler implements MetaObjectHandler {
        @Override
        public void insertFill(MetaObject metaObject) {
            this.strictInsertFill(metaObject,"createTime", Date.class,new Date());
        }
    
        @Override
        public void updateFill(MetaObject metaObject) {
            this.strictUpdateFill(metaObject,"updateTime",Date.class,new Date());
        }
    }
    

     MybatisPlus分页配置

    package com.example.ssmp.congif;
    
    import com.baomidou.mybatisplus.annotation.DbType;
    import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
    import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
    import org.springframework.context.annotation.Bean;
    import org.springframework.context.annotation.Configuration;
    
    /**
     * @author hrui
     * @date 2023/11/10 3:10
     */
    @Configuration
    public class MyBatisPlusPageInterceptor {
    
        /**
         * 添加分页插件
         */
    //    @Bean
    //    public MybatisPlusInterceptor mybatisPlusInterceptor() {
    //        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
    //        interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));//如果配置多个插件,切记分页最后添加
    //        //interceptor.addInnerInterceptor(new PaginationInnerInterceptor()); 如果有多数据源可以不配具体类型 否则都建议配上具体的DbType
    //        return interceptor;
    //    }
    
        @Bean
        public MybatisPlusInterceptor mybatisPlusInterceptor(){
            MybatisPlusInterceptor mybatisPlusInterceptor=new MybatisPlusInterceptor();
            mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
            return mybatisPlusInterceptor;
        }
    }
    

    前端

    1. <!DOCTYPE html>
    2. <html>
    3. <head>
    4. <!-- 页面meta -->
    5. <meta charset="utf-8">
    6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
    7. <title>基于SpringBoot整合SSM案例</title>
    8. <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    9. <!-- 引入样式 -->
    10. <link rel="stylesheet" href="../plugins/elementui/index.css">
    11. <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    12. <link rel="stylesheet" href="../css/style.css">
    13. </head>
    14. <body class="hold-transition">
    15. <div id="app">
    16. <div class="content-header">
    17. <h1>图书管理</h1>
    18. </div>
    19. <div class="app-container">
    20. <div class="box">
    21. <div class="filter-container">
    22. <el-input placeholder="图书类别" v-model="pagination.type" style="width: 200px;" class="filter-item"></el-input>
    23. <el-input placeholder="图书名称" v-model="pagination.name" style="width: 200px;" class="filter-item"></el-input>
    24. <el-input placeholder="图书描述" v-model="pagination.descRiption" style="width: 200px;" class="filter-item"></el-input>
    25. <el-button @click="getAll()" class="dalfBut">查询</el-button>
    26. <el-button type="primary" class="butT" @click="handleCreate()">新建</el-button>
    27. </div>
    28. <el-table size="small" current-row-key="id" :data="dataList" stripe highlight-current-row>
    29. <el-table-column type="index" align="center" label="序号"></el-table-column>
    30. <el-table-column prop="type" label="图书类别" align="center"></el-table-column>
    31. <el-table-column prop="name" label="图书名称" align="center"></el-table-column>
    32. <el-table-column prop="descRiption" label="描述" align="center"></el-table-column>
    33. <el-table-column label="操作" align="center">
    34. <template slot-scope="scope">
    35. <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">编辑</el-button>
    36. <el-button type="danger" size="mini" @click="handleDelete(scope.row)">删除</el-button>
    37. </template>
    38. </el-table-column>
    39. </el-table>
    40. <!--分页组件-->
    41. <div class="pagination-container">
    42. <el-pagination
    43. class="pagiantion"
    44. @current-change="handleCurrentChange"
    45. :current-page="pagination.currentPage"
    46. :page-size="pagination.pageSize"
    47. layout="total, prev, pager, next, jumper"
    48. :total="pagination.total">
    49. </el-pagination>
    50. </div>
    51. <!-- 新增标签弹层 -->
    52. <div class="add-form">
    53. <el-dialog title="新增图书" :visible.sync="dialogFormVisible">
    54. <el-form ref="dataAddForm" :model="formData" :rules="rules" label-position="right" label-width="100px">
    55. <el-row>
    56. <el-col :span="12">
    57. <el-form-item label="图书类别" prop="type">
    58. <el-input v-model="formData.type"/>
    59. </el-form-item>
    60. </el-col>
    61. <el-col :span="12">
    62. <el-form-item label="图书名称" prop="name">
    63. <el-input v-model="formData.name"/>
    64. </el-form-item>
    65. </el-col>
    66. </el-row>
    67. <el-row>
    68. <el-col :span="24">
    69. <el-form-item label="描述">
    70. <el-input v-model="formData.descRiption" type="textarea"></el-input>
    71. </el-form-item>
    72. </el-col>
    73. </el-row>
    74. </el-form>
    75. <div slot="footer" class="dialog-footer">
    76. <el-button @click="cancel()">取消</el-button>
    77. <el-button type="primary" @click="handleAdd()">确定</el-button>
    78. </div>
    79. </el-dialog>
    80. </div>
    81. <!-- 编辑标签弹层 -->
    82. <div class="add-form">
    83. <el-dialog title="编辑检查项" :visible.sync="dialogFormVisible4Edit">
    84. <el-form ref="dataEditForm" :model="formData" :rules="rules" label-position="right" label-width="100px">
    85. <el-row>
    86. <el-col :span="12">
    87. <el-form-item label="图书类别" prop="type">
    88. <el-input v-model="formData.type"/>
    89. </el-form-item>
    90. </el-col>
    91. <el-col :span="12">
    92. <el-form-item label="图书名称" prop="name">
    93. <el-input v-model="formData.name"/>
    94. </el-form-item>
    95. </el-col>
    96. </el-row>
    97. <el-row>
    98. <el-col :span="24">
    99. <el-form-item label="描述">
    100. <el-input v-model="formData.descRiption" type="textarea"></el-input>
    101. </el-form-item>
    102. </el-col>
    103. </el-row>
    104. </el-form>
    105. <div slot="footer" class="dialog-footer">
    106. <el-button @click="cancel()">取消</el-button>
    107. <el-button type="primary" @click="handleEdit()">确定</el-button>
    108. </div>
    109. </el-dialog>
    110. </div>
    111. </div>
    112. </div>
    113. </div>
    114. </body>
    115. <!-- 引入组件库 -->
    116. <script src="../js/vue.js"></script>
    117. <script src="../plugins/elementui/index.js"></script>
    118. <script type="text/javascript" src="../js/jquery.min.js"></script>
    119. <script src="../js/axios-0.18.0.js"></script>
    120. <script>
    121. var vue = new Vue({
    122. el: '#app',
    123. data:{
    124. dataList: [],//当前页要展示的列表数据
    125. dialogFormVisible: false,//添加表单是否可见
    126. dialogFormVisible4Edit:false,//编辑表单是否可见
    127. formData: {},//表单数据
    128. rules: {//校验规则
    129. type: [{ required: true, message: '图书类别为必填项', trigger: 'blur' }],
    130. name: [{ required: true, message: '图书名称为必填项', trigger: 'blur' }]
    131. },
    132. pagination: {//分页相关模型数据
    133. currentPage: 1,//当前页码
    134. pageSize:10,//每页显示的记录数
    135. total:0,//总记录数
    136. type:"",//图书类别
    137. name:"",//图书名称
    138. descRiption:""//描述
    139. }
    140. },
    141. //钩子函数,VUE对象初始化完成后自动执行
    142. created() {
    143. //调用查询全部数据的操作
    144. this.getAll();
    145. },
    146. methods: {
    147. //列表
    148. // getAll() {
    149. // //发送异步请求
    150. // axios.get("/books").then((res)=>{
    151. // console.log(res)
    152. // if(res.data.flag){
    153. // this.dataList=res.data.data
    154. // }
    155. // })
    156. // },
    157. //弹出添加窗口
    158. handleCreate() {
    159. this.resetForm()
    160. //打开新增窗口
    161. this.dialogFormVisible=true
    162. },
    163. //重置表单
    164. resetForm() {
    165. //清理数据
    166. this.formData={}
    167. },
    168. //添加
    169. handleAdd () {
    170. axios.post("/books",this.formData).then((res)=>{
    171. console.log(res)
    172. if(res.data.flag){
    173. this.dialogFormVisible=false
    174. this.$message.success("添加成功")
    175. }else{
    176. //this.$message.error("添加失败")
    177. this.$message.error(res.data.msg)
    178. }
    179. }).finally(()=>{
    180. //重新加载数据
    181. this.getAll()
    182. })
    183. },
    184. //取消
    185. cancel(){
    186. //关闭新增窗口
    187. this.dialogFormVisible=false
    188. this.dialogFormVisible4Edit=false
    189. this.$message.info("当前操作取消")
    190. },
    191. // 删除
    192. handleDelete(row) {
    193. //弹出提示框 防止误删
    194. this.$confirm("此操作永久删除,是否继续?",{type: "info"}).then(()=>{
    195. //确定
    196. let id=row.id
    197. axios.delete("/books/"+id).then((res)=>{
    198. if(res.data.flag){
    199. this.$message.success("删除成功")
    200. }else{
    201. //this.$message.error("数据同步失败,自动刷新")
    202. this.$message.error(res.data.msg)
    203. }
    204. }).finally(()=>{
    205. //重新加载数据
    206. this.getAll()
    207. })
    208. //取消
    209. }).catch(()=>{
    210. this.$message.info("取消操作")
    211. })
    212. },
    213. //弹出编辑窗口
    214. handleUpdate(row) {
    215. axios.get("/books/"+row.id).then((res)=>{
    216. if(res.data.flag&&res.data.data!=null){
    217. this.formData=res.data.data
    218. this.dialogFormVisible4Edit=true
    219. }else{
    220. //this.$message.error("数据同步失败,自动刷新")
    221. this.$message.error(res.data.msg)
    222. this.dialogFormVisible4Edit=false
    223. }
    224. }).finally(()=>{
    225. //刷新页面
    226. this.getAll()
    227. })
    228. //this.formData=row
    229. //this.dialogFormVisible4Edit=true
    230. },
    231. //修改
    232. handleEdit() {
    233. var data=[]
    234. data.push(this.formData)
    235. axios.put("/books",data).then((res)=>{
    236. console.log(res)
    237. if(res.data.flag){
    238. //关闭弹窗
    239. this.dialogFormVisible4Edit=false
    240. this.$message.success("修改成功")
    241. }else{
    242. //this.$message.error("修改失败")
    243. this.$message.error(res.data.msg)
    244. }
    245. }).finally(()=>{
    246. //重新加载数据
    247. this.getAll()
    248. })
    249. },
    250. //分页查询
    251. getAll(){
    252. axios.get("/books/"+this.pagination.currentPage+"/"+this.pagination.pageSize+"?name="+this.pagination.name+"&type="+this.pagination.type+"&descRiption="+this.pagination.descRiption).then((res)=>{
    253. console.log(res)
    254. if(res.data.flag){
    255. this.dataList=res.data.data.records
    256. this.pagination.currentPage=res.data.data.current//当前页
    257. this.pagination.pageSize=res.data.data.size//
    258. this.pagination.total=res.data.data.total//总条数
    259. }
    260. })
    261. },
    262. //切换页码
    263. handleCurrentChange(currentPage) {
    264. //修改页为当前页
    265. this.pagination.currentPage=currentPage
    266. //执行查询
    267. this.getAll()
    268. },
    269. //条件查询
    270. }
    271. })
    272. </script>
    273. </html>

    前端页面网盘地址

    链接:https://pan.baidu.com/s/1BcQXH8gdPZuPfxJ0Lx2wcg 
    提取码:uude 
    --来自百度网盘超级会员V4的分享

  • 相关阅读:
    Aardio - 调用Python库下载蓝奏盘文件
    LeetCode题集——分割链表 + 删除排序链表中的重复元素(1+2)
    【C++】常用拷贝和替换算法
    模板方法模式
    深度学习项目实战:垃圾分类系统
    操作系统 | 内存管理
    链接Token参数可逆
    Ubuntu修改下载源
    jasperreports6.12.2 could not load the following font解决方法
    【C程序设计】用心浇灌<C程序>
  • 原文地址:https://blog.csdn.net/tiantiantbtb/article/details/134323096