-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
OnlineSurveyBackEnd/src/main/java/qdu/suvvm/onlinesurvey/config/CorsConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package qdu.suvvm.onlinesurvey.config; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
|
||
/** | ||
* @Author: SUVVM | ||
* @Date: 2019/11/13 19:21 | ||
*/ | ||
@Configuration | ||
public class CorsConfig implements WebMvcConfigurer { | ||
/** | ||
* 页面跨域访问Controller过滤 | ||
* | ||
* @return | ||
*/ | ||
@Override | ||
public void addCorsMappings(CorsRegistry registry) { | ||
WebMvcConfigurer.super.addCorsMappings(registry); | ||
registry.addMapping("/**") | ||
.allowedHeaders("*") | ||
.allowedMethods("POST","GET") | ||
.allowedOrigins("*"); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
OnlineSurveyBackEnd/src/main/java/qdu/suvvm/onlinesurvey/controller/SmsController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package qdu.suvvm.onlinesurvey.controller; | ||
|
||
/** | ||
* @Author: SUVVM | ||
* @Date: 2019/11/13 19:17 | ||
*/ | ||
public class SmsController { | ||
} |