質問編集履歴

5

コードを修正

2021/11/20 18:22

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -56,7 +56,7 @@
56
56
 
57
57
  e.Use(middleware.CORS())
58
58
 
59
- e.POST("/api/login", Login)
59
+ e.POST("/login", Login)
60
60
 
61
61
  }
62
62
 

4

コードを修正

2021/11/20 18:22

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -145,51 +145,3 @@
145
145
  axios 0.24.0
146
146
 
147
147
  axios-hooks 2.7.0
148
-
149
-
150
-
151
-
152
-
153
- ###追記
154
-
155
- ```go
156
-
157
- loc, err := time.LoadLocation("Asia/Tokyo")
158
-
159
- if err != nil {
160
-
161
- loc = time.FixedZone("Asia/Tokyo", 9*60*60)
162
-
163
- }
164
-
165
- time.Local = loc
166
-
167
-
168
-
169
- e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
170
-
171
- AllowOrigins: []string{"http://localhost:3000"},
172
-
173
- AllowMethods: []string{http.MethodGet, http.MethodHead, http.MethodPut, http.MethodPatch, http.MethodPost, http.MethodDelete},
174
-
175
- AllowCredentials: true,
176
-
177
- }))
178
-
179
- ```
180
-
181
-
182
-
183
- ```
184
-
185
- const axiosInstance = axios.create({
186
-
187
- baseURL: 'http://localhost:8080',
188
-
189
- withCredentials: true,
190
-
191
- });
192
-
193
-
194
-
195
- ```

3

コードの追加

2021/11/20 18:22

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -108,7 +108,7 @@
108
108
 
109
109
  const axiosInstance = axios.create({
110
110
 
111
- baseURL: 'http://localhost:8080/api/'
111
+ baseURL: 'http://localhost:8080'
112
112
 
113
113
  });
114
114
 
@@ -145,3 +145,51 @@
145
145
  axios 0.24.0
146
146
 
147
147
  axios-hooks 2.7.0
148
+
149
+
150
+
151
+
152
+
153
+ ###追記
154
+
155
+ ```go
156
+
157
+ loc, err := time.LoadLocation("Asia/Tokyo")
158
+
159
+ if err != nil {
160
+
161
+ loc = time.FixedZone("Asia/Tokyo", 9*60*60)
162
+
163
+ }
164
+
165
+ time.Local = loc
166
+
167
+
168
+
169
+ e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
170
+
171
+ AllowOrigins: []string{"http://localhost:3000"},
172
+
173
+ AllowMethods: []string{http.MethodGet, http.MethodHead, http.MethodPut, http.MethodPatch, http.MethodPost, http.MethodDelete},
174
+
175
+ AllowCredentials: true,
176
+
177
+ }))
178
+
179
+ ```
180
+
181
+
182
+
183
+ ```
184
+
185
+ const axiosInstance = axios.create({
186
+
187
+ baseURL: 'http://localhost:8080',
188
+
189
+ withCredentials: true,
190
+
191
+ });
192
+
193
+
194
+
195
+ ```

2

コードの修正

2021/11/20 18:20

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -86,7 +86,7 @@
86
86
 
87
87
  }
88
88
 
89
- c.SetCookie(c.Response().Writer, myCookie)
89
+ c.SetCookie(myCookie)
90
90
 
91
91
 
92
92
 

1

文言の追加

2021/11/20 17:10

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -63,6 +63,10 @@
63
63
 
64
64
 
65
65
  func Login(c echo.Context) error {
66
+
67
+ // 省略
68
+
69
+
66
70
 
67
71
  myCookie := &http.Cookie{
68
72