Bläddra i källkod

Merge pull request #4551 from SHLE1/fix/email-bind-post-method

bug fix: 新版前端email绑定错误
Calcium-Ion 1 vecka sedan
förälder
incheckning
22fd1741ab
2 ändrade filer med 7 tillägg och 3 borttagningar
  1. 3 2
      web/default/src/features/auth/api.ts
  2. 4 1
      web/default/src/features/profile/api.ts

+ 3 - 2
web/default/src/features/auth/api.ts

@@ -109,8 +109,9 @@ export async function bindEmail(
   email: string,
   email: string,
   code: string
   code: string
 ): Promise<ApiResponse> {
 ): Promise<ApiResponse> {
-  const res = await api.get('/api/oauth/email/bind', {
-    params: { email, code },
+  const res = await api.post('/api/oauth/email/bind', {
+    email,
+    code,
   })
   })
   return res.data
   return res.data
 }
 }

+ 4 - 1
web/default/src/features/profile/api.ts

@@ -85,7 +85,10 @@ export async function bindEmail(
   email: string,
   email: string,
   code: string
   code: string
 ): Promise<ApiResponse> {
 ): Promise<ApiResponse> {
-  const res = await api.get(`/api/oauth/email/bind?email=${email}&code=${code}`)
+  const res = await api.post('/api/oauth/email/bind', {
+    email,
+    code,
+  })
   return res.data
   return res.data
 }
 }