springboot相关配置
在resources
文件夹下新建一个banner.txt
文件,加入相关内容即可,艺术字生成网站
---------------+--------------- ___ /^^[___ _ /|^+----+ |#___________// ( -+ |____| ______-----+/ ==_________--' \ ~_|___|__
|
2. 跨域请求
添加此配置到WebMvc
配置类中(推荐),也可以在每个Controller
类上添加注解@CrossOrigin
@Configuration public class WebMvcConfig implements WebMvcConfigurer { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedOriginPatterns("*") .allowedMethods("*") .allowedHeaders("*") .allowCredentials(true); } }
|
3. application配置文件
application.yml
server: port: 8080
spring: profiles: active: dev main: allow-circular-references: true devtools: restart: enabled: true additional-paths: src/main/java
mybatis-plus: configuration: map-underscore-to-camel-case: true type-aliases-package: com.clb.pojo mapper-locations: classpath:mapper/*.xml global-config: banner: false db-config: id-type: auto
logging: level: com.clb: debug pattern: dateformat: MM-dd HH:mm:ss.SSS
|
application-dev.yml
spring: config: activate: on-profile: dev datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/mybatis?rewriteBatchedStatements=true username: root password: 123456 data: redis: host: 192.168.0.88 password: 123456 port: 6379 database: 0
|