springboot复习(黑马)
创始人
2025-05-29 16:05:53
0

学习目标


基于SpringBoot框架的程序开发步骤

熟练使用SpringBoot配置信息修改服务器配置

基于SpringBoot的完成SSM整合项目开发

一、SpringBoot简介


1. 入门案例

问题导入

SpringMVC的HelloWord程序大家还记得吗?

  • SpringBoot是由Pivotal团队提供的全新框架,其设计目的是用来简化Spring应用的初始搭建以及开发过程

  • 原生开发SpringMVC程序过程

1.1 入门案例开发步骤

环境准备

①:创建新模块,选择Spring初始化,并配置模块相关基础信息
②:选择当前模块需要使用的技术集
③:开发控制器类
@RestController
public class Controller01 {@RequestMapping("/sayHi")public String sayHi(){System.out.println("hi...");return "hi ... springboot...";}
}

④:运行自动生成的Application类

访问页面

重新启动

最简SpringBoot程序所包含的基础文件


4.0.0org.springframework.bootspring-boot-starter-parent2.7.1 com.itheimademo1_helloworld0.0.1-SNAPSHOTdemo1_helloworldDemo project for Spring Boot1.8org.springframework.bootspring-boot-starter-weborg.springframework.bootspring-boot-starter-testtestorg.springframework.bootspring-boot-maven-plugin
package com.itheima;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;/*/*@SpringBootApplication:1. 表示这个类是一个springboot应用程序的入口类。2. 要想让程序启动,只需要在main方法里面写上这样的一句话:SpringApplication.run(当前类的字节码对象, args);3. 拓展:3.1 springboot项目启动的时候,默认会扫描启动类所在的位置,以及它后续的所有子包。3.2 查找到类里面打的注解 @Controller , @Service , @RequestMapping.3.3 springApplication.run 传递进去当前类的字节码对象,也是可以确定当前这个启动器它的包是哪个!*/
@SpringBootApplication
public class Demo1HelloworldApplication {public static void main(String[] args) {SpringApplication.run(Demo1HelloworldApplication.class, args);}}

Spring程序与SpringBoot程序对比

注意事项:

基于idea开发SpringBoot程序需要确保联网且能够加载到程序框架结构

1.2 基于SpringBoot官网创建项目

保存到桌面

解压完之后 用idea打开他

因为用到了Mysql 所以得配置数据库

已经启动

1.3 SpringBoot项目快速启动

① 对SpringBoot项目打包(执行Maven构建指令package)

② 执行启动指令

java -jar ava -jar demo1_helloworld-0.0.1-SNAPSHOT.jar    # 项目的名称根据实际情况修改

例子

注意事项:

jar支持命令行启动需要依赖maven插件支持,请确认打包时是否具有SpringBoot对应的maven插件。

 org.springframework.bootspring-boot-maven-plugin

如果没有这个依赖maven插件 打包就只有4k左右

这个时候跟本运行不了

2. SpringBoot概述

问题导入

学习了SpringBoot入门案例之后,感觉对比SpringMVC哪一个更加方便简洁?

  • SpringBoot是由Pivotal团队提供的全新框架,其设计目的是用来简化Spring应用的初始搭建以及开发过程

  • Spring程序缺点

  • 配置繁琐

  • 依赖设置繁琐

  • SpringBoot程序优点

  • 自动配置

  • 起步依赖(简化依赖配置)

  • 辅助功能(内置服务器,……)

28行到225行

226行 到2737行

2.1 起步依赖

  • starter

  • SpringBoot中常见项目名称,定义了当前项目使用的所有项目坐标,以达到减少依赖配置的目的

  • 可以认为这个起步依赖相当于一个开关 我们主要用了这个东西 就相当用了他的全套功能

   org.springframework.bootspring-boot-starter-weborg.springframework.bootspring-boot-starter-testtest

parent

  • 所有SpringBoot项目要继承的项目,定义了若干个坐标版本号(依赖管理,而非依赖),以达到减少依赖冲突的目的

  • spring-boot-starter-parent(2.5.0)与 spring-boot-starter-parent(2.4.6)共计57处坐标版本不同


4.0.0org.springframework.bootspring-boot-starter-parent2.7.1 com.itheimademo1_helloworld0.0.1-SNAPSHOTdemo1_helloworldDemo project for Spring Boot

4.0.0org.springframework.bootspring-boot-dependencies2.5.0spring-boot-starter-parentpom    ...

实际开发

  • 使用任意坐标时,仅书写GAV中的G和A,V由SpringBoot提供

  • 如发生坐标错误,再指定version(要小心版本冲突)

如我们要用到Mysql

     mysqlmysql-connector-java

当然也不是什么都有管理

比如druid就不被管理

 com.alibabadruid1.2.8

如果不写版本号的话 就会出现unknown 这个时候 我们就知道在springboot的父亲的父亲里面并没有管理这个依赖 这个时候 我们就能自己添加版本号

自己添加版本号

2.2 辅助功能

  • SpringBoot程序启动

package com.itheima;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;/*/*@SpringBootApplication:1. 表示这个类是一个springboot应用程序的入口类。2. 要想让程序启动,只需要在main方法里面写上这样的一句话:SpringApplication.run(当前类的字节码对象, args);3. 拓展:3.1 springboot项目启动的时候,默认会扫描启动类所在的位置,以及它后续的所有子包。3.2 查找到类里面打的注解 @Controller , @Service , @RequestMapping.3.3 springApplication.run 传递进去当前类的字节码对象,也是可以确定当前这个启动器它的包是哪个!*/
@SpringBootApplication
public class Demo1HelloworldApplication {public static void main(String[] args) {SpringApplication.run(Demo1HelloworldApplication.class, args);}}
  • SpringBoot在创建项目时,采用jar的打包方式

  • SpringBoot的引导类是项目的入口,运行main方法就可以启动项目

  • 使用maven依赖管理变更起步依赖项

  • Jetty比Tomcat更轻量级,可扩展性更强(相较于Tomcat),谷歌应用引擎(GAE)已经全面切换为Jetty

org.springframework.bootspring-boot-starter-weborg.springframework.bootspring-boot-starter-jettymysqlmysql-connector-javacom.alibabadruid1.2.8org.springframework.bootspring-boot-starter-testtest

全部pom.xml

`
4.0.0org.springframework.bootspring-boot-starter-parent2.7.1 com.itheimademo1_helloworld0.0.1-SNAPSHOTdemo1_helloworldDemo project for Spring Boot1.8org.springframework.bootspring-boot-starter-weborg.springframework.bootspring-boot-starter-jettymysqlmysql-connector-javacom.alibabadruid1.2.8org.springframework.bootspring-boot-starter-testtestorg.springframework.bootspring-boot-maven-plugin

二、基础配置

环境准备 demo2_properties

前面的创建操作和demo1类似 不在展示


1. 配置文件格式

问题导入

框架常见的配置文件有哪几种形式?

1.1 修改服务器端口

SpringBoot提供了多种属性配置方式

  • application.properties

server.port=8081

重启

小备注:如果发现启动报错

解决办法

查看进程 看看有没的被人家使用了

发现被14452使用了

打开任务管理器

找到14452

在重新启动就可以

application.yml

server:port: 8082

重新启动

application.yaml

server:port: 8083

发现不提示 解决办法 1.2 自动提示功能消失解决方案

解决完小叶子问题之 后 就会有提示了

重启

1.2 自动提示功能消失解决方案

操作步骤:

第一种:

如果发现上面的ok点不了 可能是没有application.properties 我们要先把这个给创建出来

第二种

1.3 SpringBoot配置文件加载顺序(了解)

  • application.properties > application.yml > application.yaml

注意事项:

  1. SpringBoot核心配置文件名为application

  1. SpringBoot内置属性过多,且所有属性集中在一起修改,在使用时,通过提示键+关键字修改属性

2. yaml

问题导入

什么是yaml,和properties有什么区别?

  • YAML(YAML Ain't Markup Language),一种数据序列化格式

  • 优点:

  • 容易阅读

  • 容易与脚本语言交互

  • 以数据为核心,重数据轻格式

  • YAML文件扩展名

  • .yml(主流)

  • .yaml

2.1 yaml语法规则

  • 大小写敏感

  • 属性层级关系使用多行描述,每行结尾使用冒号结束

  • 使用缩进表示层级关系,同层级左侧对齐,只允许使用空格(不允许使用Tab键)

  • 属性值前面添加空格(属性名与属性值之间使用冒号+空格作为分隔)

  • #表示注释

  • 核心规则:数据前面要加空格与冒号隔开

2.2 yaml数组数据

  • 数组数据在数据书写位置的下方使用减号作为数据开始符号,每行书写一个数据,减号与数据间空格分隔

数组数据在数据书写位置的下方使用减号作为数据开始符号,每行书写一个数据,减号与数据间空格分隔

2.3 yaml数据读取

  • 2.3.1 使用@Value读取单个数据,属性名引用方式:${一级属性名.二级属性名……}
package com.itheima.web;/*在这个类里面,使用@Value来读取yml文件中的数据。*/import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class Controller01 {@Value("${lesson}")private String lesson;//@Value("${第一层.第二层.第三层.属性名}")@Value("${server.port}")private String port;@Value("${enterprise.name}")private String name;@Value("${enterprise.subject[0]}")private String subject;@RequestMapping("/readYml")public String readYml(){System.out.println("lesson = " + lesson);System.out.println("port = " + port);System.out.println("name = " + name);System.out.println("subject = " + subject);return "hi springboot...";}
}
lesson: SpringBootserver:port: 8082enterprise:name: 传智播客age: 16tel: 4006184000subject:- Java- 前端- 大数据

注:如果报错的话 修改一下编码

如果还报错的话 就clean一下

如果还是报错的话

如果还是报错 我们就把前面没有用到的application.properties和application.yaml的端口号给注释了或把这二个文件删除

端口号给注释了

或删除

  • 2.3.2 封装全部数据到Environment对象
package com.itheima.web;/*在这个类里面,使用Environment来读取yml文件中的数据。*/import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;@RestController
public class Controller02 {@Autowiredprivate Environment env;@RequestMapping("/readYml02")public String readYml(){System.out.println("lesson = " + env.getProperty("lesson"));System.out.println("port = " + env.getProperty("server.port"));System.out.println("name = " + env.getProperty("enterprise.name"));System.out.println("subject = " + env.getProperty("enterprise.subject[0]"));return "hi springboot.0222..";}
}
lesson: SpringBootserver:port: 8082enterprise:name: 传智播客age: 16tel: 4006184000subject:- Java- 前端- 大数据
  • 2.3.3 自定义对象封装指定数据【常用】==

因为封装 要得到属性 用到@Data注解 所以要加入以下依赖

      org.projectlomboklombok

package com.itheima.bean;import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;@Data
@Component
@ConfigurationProperties(prefix = "enterprise")
public class Enterprise {private String name;private int age ;private String tel;private String [] subject;
}
package com.itheima.web;/*在这个类里面,使用Environment来读取yml文件中的数据。*/import com.itheima.bean.Enterprise;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;import java.util.Arrays;@RestController
public class Controller03 {@Autowiredprivate Enterprise enterprise;@RequestMapping("/readYml03")public String readYml(){System.out.println("enterprise = " + enterprise);return "hi springboot.0333..";}
}
lesson: SpringBootserver:port: 8082enterprise:name: 传智播客age: 16tel: 4006184000subject:- Java- 前端- 大数据

自定义对象封装数据警告解决方案

问题:

解决

加入依赖

       org.springframework.bootspring-boot-configuration-processortrue

3. 多环境开发配置

环境准备

问题导入

在实际开发中,项目的开发环境、测试环境、生产环境的配置信息是否会一致?如何快速切换?

3.1 多环境启动配置

  • yaml文件多环境启动

3.1.1 在YML文件多环境启动
# 激活具体的环境
spring:profiles:active: dev---
# 定义开发环境
server:port: 80spring:config:activate:on-profile: dev
---# 定义生产环境
server:port: 81spring:config:activate:on-profile: prod---
# 定义测试环境
server:port: 82
spring:config:activate:on-profile: test

3.1.2 properties文件多环境启动

application.properties

# 使用properties的文件格式来定义多环境
# 1. 一套环境就一个properties文件,命名格式: application-环境的id.properries
# 2. 在application.properties 里面激活具体的环境。
spring.profiles.active=dev

application-dev.properties

server.port=8081

application-prod.properties

server.port=8082

application-test.properties

server.port=8083

启动

3.2 多环境启动命令格式

把application.properties放到properties-bak

  • 带参数启动SpringBoot

打包

重新cmd 修改端口

参数加载优先顺序

  • 参看文档:https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config

3.3 多环境开发控制

Maven与SpringBoot多环境兼容(步骤)

环境准备

①:Maven中设置多环境属性
dev_mvndevtrueprod_mvnprodtest_mvntest
②:SpringBoot中引用Maven属性
# 激活具体的环境
spring:profiles:active: ${a} # 这里的值是动态变化的,由maven来控制它的变化---
# 声明开发环境
server:port: 80
spring:config:activate:on-profile: dev
---
# 声明生产环境
server:port: 81
spring:config:activate:on-profile: prod
---
# 声明测试环境
server:port: 82
spring:config:activate:on-profile: test

③:执行Maven编译指令

  • Maven指令执行完毕后,生成了对应的包,其中类参与编译,但是配置文件并没有编译,而是复制到包中

解决思路:对于源码中非java类的操作要求加载Maven对应的属性,解析${}占位符

④:对资源文件开启对默认占位符的解析
    maven-resources-pluginutf-8true

重新编译

Maven编译加载到属性,编译顺利通过

如果想要换其他的环境

也可以用命令的方式

打包

4. 配置文件分类

问题导入

SpringBoot的配置文件可以放在项目的哪些地方?

java –jar springboot.jar --spring.profiles.active=test --server.port=85 --server.servlet.context-path=/heima --server.tomcat.connection-timeout=-1 ... ...
  • SpringBoot中4级配置文件

1级: file :config/application.yml 【最高】

2级: file :application.yml

3级:classpath:config/application.yml

4级:classpath:application.yml 【最低】

  • 作用:

1级与2级留做系统打包后设置通用属性

3级与4级用于系统开发阶段设置通用属性

  • 演示3级和4级

优先使用8888端口 因为config/application.yml的优先级高于application.yml 【最低】

  • 演示第二级

  • 演示第一级

Ctrl+C 结束前面的

重新启动

三、整合第三方技术


1. 整合JUnit

环境准备

有web

org.springframework.bootspring-boot-starter-web

无web

org.springframework.bootspring-boot-starter

不导入web也是可以自动扫描包 也是可以自动创建工程

问题导入

回忆一下Spring整合JUnit的步骤?

1.1 Spring整合JUnit(复习)

1.2 SpringBoot整合JUnit

先跑一下自己写的测试类

@SpringBootTest
public class MyTest {@Testpublic void test01(){System.out.println("test01....");}
}

在MyTest里面测试service的方法

测试类

package com.itheima;
import com.itheima.service.UserService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;@SpringBootTest
public class MyTest {@Autowiredprivate UserService us;@Testpublic void test01(){System.out.println("test01....");us.add();}
}

接口

package com.itheima.service;public interface UserService {void add();
}

实现类

package com.itheima.service.impl;import com.itheima.service.UserService;
import org.springframework.stereotype.Service;@Service
public class UserServiceImpl implements UserService {@Overridepublic void add() {System.out.println("调用了UserServiceImpl的add方法~!!~");}
}

@SpringBootTest解释

@SpringBootTest(classes = Demo5JunitApplication.class)

什么时候加classes

1. 如果测试类所在的包 是 位于 启动类所在的包或者它的子包里面, 或者大家的包名一致,那么可以省略启动类不写!

启动类: com.itheima

测试: com.itheima

2. 如果测试类所在的包,并不是位于启动类所在包的下面,那么一定要指定启动类是谁, 否则有可能出错!

比如我们把test包放到com下面 不写classes就会出错

如果写上classes

2. 基于SpringBoot实现SSM整合

问题导入

回忆一下Spring整合MyBatis的核心思想?

2.1 Spring整合MyBatis(复习)

2.1 Spring整合MyBatis(复习)

  • SpringConfig

  • 导入JdbcConfig

  • 导入MyBatisConfig

`@Configuration
@ComponentScan("com.itheima")
@PropertySource("classpath:jdbc.properties")
@Import({JdbcConfig.class, MyBatisConfig.class})
public class SpringConfig {}

JDBCConfig

  • 定义数据源(加载properties配置项:driver、url、username、password)

#jdbc.properties
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/spring_db
jdbc.username=root
jdbc.password=itheima
public class JdbcConfig {@Value("${jdbc.driver}")private String driver;@Value("${jdbc.url}")private String url;@Value("${jdbc.username}")private String userName;@Value("${jdbc.password}")private String password;@Beanpublic DataSource getDataSource() {DruidDataSource ds = new DruidDataSource();ds.setDriverClassName(driver);ds.setUrl(url);ds.setUsername(userName);ds.setPassword(password);return ds;}
}

MyBatisConfig

  • 定义SqlSessionFactoryBean

  • 定义映射配置

@Bean
public SqlSessionFactoryBean getSqlSessionFactoryBean(DataSource dataSource) {SqlSessionFactoryBean ssfb = new SqlSessionFactoryBean();ssfb.setTypeAliasesPackage("com.itheima.domain");ssfb.setDataSource(dataSource);return ssfb;
}
@Bean
public MapperScannerConfigurer getMapperScannerConfigurer() {MapperScannerConfigurer msc = new MapperScannerConfigurer();msc.setBasePackage("com.itheima.dao");return msc;
}

2.2 SpringBoot整合MyBatis

  • SpringBoot整合Spring(不存在)

  • SpringBoot整合SpringMVC(不存在)

  • SpringBoot整合MyBatis(主要)

①:创建新模块,选择Spring初始化,并配置模块相关基础信息
②:选择当前模块需要使用的技术集(MyBatis、MySQL)
③:设置数据源参数
spring:datasource:type: com.alibaba.druid.pool.DruidDataSourcedriver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://localhost:3306/springboot_testusername: rootpassword: 123456

注意事项:

  1. SpringBoot版本低于2.4.3(不含),Mysql驱动版本大于8.0时,需要在url连接串中配置时区,或在MySQL数据库端配置时区解决此问题

jdbc:mysql://localhost:3306/springboot_test?serverTimezone=UTC

加入druid连接池 和lombok依赖

   com.alibabadruid1.2.8
 org.projectlomboklombok
④:定义数据层接口与映射配置

实体类bean

package com.itheima.bean;import lombok.Data;@Data
public class Book {private int id;private String type;private String name;private String description;
}
⑤:测试类中注入dao接口,测试功能
package com.itheima.dao;import com.itheima.bean.Book;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;import java.util.List;/*要想创建出来dao的代理对象,那么需要告诉springboot,这个dao在哪里?1. 第一种做法: 就是直接在dao的接口上打上注解 @Mapper2. 第二种做法: 在启动类上打上注解: @MapperScan("com.itheima.dao")*/
@Mapper
public interface BookDao {@Select("select * from tbl_book")List findAll();
}

package com.itheima;import com.itheima.dao.BookDao;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;@SpringBootTest
class Demo6MybatisApplicationTests {@Autowiredprivate BookDao dao;@Testvoid testFindAll() {System.out.println("dao.findAll() = " + dao.findAll());}
}

测试结果:

如果不用druid连接池 就用光连接池

spring:datasource:#type: com.alibaba.druid.pool.DruidDataSourcedriver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://localhost:3306/springboot_testusername: rootpassword: 123456
/*要想创建出来dao的代理对象,那么需要告诉springboot,这个dao在哪里?1. 第一种做法: 就是直接在dao的接口上打上注解 @Mapper2. 第二种做法: 在启动类上打上注解: @MapperScan("com.itheima.dao")*/

第二种做法

package com.itheima;import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;@MapperScan("com.itheima.dao")
@SpringBootApplication
public class Demo6MybatisApplication {public static void main(String[] args) {SpringApplication.run(Demo6MybatisApplication.class, args);}}

如果二种都不打 会报以下错误

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.itheima.dao.BookDao' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}

2.3 案例-SpringBoot实现ssm整合

① 环境准备
② 导入静态页面
③ yml
spring:datasource:driver-class-name: com.mysql.cj.jdbc.Driverurl: jdbc:mysql://localhost:3306/springboot_testusername: rootpassword: 123456

启动

访问

http://localhost:8080/pages/books.html
④ 前端
         methods: {//列表getAll() {axios.get("/books").then(resp=>{console.log(resp);//this.dataList = resp.data.data;});
⑤ bean实体类
`package com.itheima.bean;import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;/*这个类是用来包装返回给前端的数据*/@AllArgsConstructor
@NoArgsConstructor
@Data
public class Result {private int code; //代表这次请求的代号: 表示成功或者表示失败private String msg; //代表这次请求的代号的一个简短说明: 添加品牌成功 或者  添加品牌失败private Object data; //代表这次请求要返回给客户端的数据,一般是针对查询操作。
}
⑥ dao接口
package com.itheima.dao;import com.itheima.bean.Book;
import org.apache.ibatis.annotations.Select;import java.util.List;public interface BookDao {@Select("select * from tbl_book")List  findAll();
}
⑦ service接口
`package com.itheima.service;import com.itheima.bean.Book;import java.util.List;public interface BookService {List findAll();
}
⑧ BookServiceImpl实现类
`package com.itheima.service.impl;import com.itheima.bean.Book;
import com.itheima.dao.BookDao;
import com.itheima.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;import java.util.List;@Service
@Transactional
public class BookServiceImpl implements BookService {@Autowiredprivate BookDao dao;@Overridepublic List findAll() {return dao.findAll();}
}
⑨ web 【Controller】
`package com.itheima.web;import com.itheima.bean.Book;
import com.itheima.bean.Result;
import com.itheima.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;import java.util.List;@RequestMapping("/books")
@RestController
public class BookController {@Autowiredprivate BookService bs;@GetMappingpublic Result findAll(){List list = bs.findAll();return new Result(1, "查询成功" , list);}
}

启动类打上@MapperScan("com.itheima.dao")

package com.itheima;import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;@MapperScan("com.itheima.dao")
@SpringBootApplication
public class Demo7SsmApplication {public static void main(String[] args) {SpringApplication.run(Demo7SsmApplication.class, args);}}

启动

⑩ 前端
 methods: {//列表getAll() {axios.get("/books").then(resp=>{console.log(resp);this.dataList = resp.data.data;});

重启

相关内容

热门资讯

AWSECS:访问外部网络时出... 如果您在AWS ECS中部署了应用程序,并且该应用程序需要访问外部网络,但是无法正常访问,可能是因为...
AWSElasticBeans... 在Dockerfile中手动配置nginx反向代理。例如,在Dockerfile中添加以下代码:FR...
银河麒麟V10SP1高级服务器... 银河麒麟高级服务器操作系统简介: 银河麒麟高级服务器操作系统V10是针对企业级关键业务...
北信源内网安全管理卸载 北信源内网安全管理是一款网络安全管理软件,主要用于保护内网安全。在日常使用过程中,卸载该软件是一种常...
AWR报告解读 WORKLOAD REPOSITORY PDB report (PDB snapshots) AW...
AWS管理控制台菜单和权限 要在AWS管理控制台中创建菜单和权限,您可以使用AWS Identity and Access Ma...
​ToDesk 远程工具安装及... 目录 前言 ToDesk 优势 ToDesk 下载安装 ToDesk 功能展示 文件传输 设备链接 ...
群晖外网访问终极解决方法:IP... 写在前面的话 受够了群晖的quickconnet的小水管了,急需一个新的解决方法&#x...
不能访问光猫的的管理页面 光猫是现代家庭宽带网络的重要组成部分,它可以提供高速稳定的网络连接。但是,有时候我们会遇到不能访问光...
Azure构建流程(Power... 这可能是由于配置错误导致的问题。请检查构建流程任务中的“发布构建制品”步骤,确保正确配置了“Arti...