Compare commits
No commits in common. "c0882ada7c970ef0b0a180f3449d36fa53e7ff86" and "c0ee8de27d4ddb41e034125869f14235fee10cf7" have entirely different histories.
c0882ada7c
...
c0ee8de27d
|
@ -1,19 +0,0 @@
|
||||||
package cn.bunny.config;
|
|
||||||
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
public class CorsConfig implements WebMvcConfigurer {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addCorsMappings(CorsRegistry registry) {
|
|
||||||
registry.addMapping("/**") // 所有接口
|
|
||||||
.allowedOrigins("*") // 允许所有来源
|
|
||||||
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") // 允许方法
|
|
||||||
.allowedHeaders("*") // 允许所有头
|
|
||||||
// .allowCredentials(true) // 允许凭证
|
|
||||||
.maxAge(3600); // 预检请求缓存时间
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<div class="container-fluid my-4">
|
<div class="container my-4">
|
||||||
<!-- 主标题 -->
|
<!-- 主标题 -->
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<div class="container-fluid my-4">
|
<div class="container my-4">
|
||||||
<!-- 主标题 -->
|
<!-- 主标题 -->
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue