質問編集履歴
1
コードがきちんとファイルごとになっていなかったので修正しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -13,9 +13,7 @@
|
|
13
13
|
```
|
14
14
|
エラーメッセージ
|
15
15
|
Access to XMLHttpRequest at 'http://localhost:8080/login' from origin 'http://localhost:8081' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
|
16
|
-
|
17
|
-
|
16
|
+
```
|
18
|
-
|
19
17
|
```Login.vue
|
20
18
|
login() {
|
21
19
|
axios
|
@@ -31,6 +29,7 @@
|
|
31
29
|
this.showError = true;
|
32
30
|
});
|
33
31
|
},
|
32
|
+
```
|
34
33
|
```SecurityConfig.java
|
35
34
|
@Configuration
|
36
35
|
@EnableWebSecurity
|
@@ -50,6 +49,7 @@
|
|
50
49
|
return http.build();
|
51
50
|
}
|
52
51
|
}
|
52
|
+
```
|
53
53
|
```LoginController.java
|
54
54
|
@RestController
|
55
55
|
@RequestMapping("/")
|
@@ -65,3 +65,4 @@
|
|
65
65
|
return "logout";
|
66
66
|
}
|
67
67
|
}
|
68
|
+
```
|