소스 검색

第三方登录回调地址修改

ifcheng 2 년 전
부모
커밋
c523386bc8
2개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 1
      .env.production
  2. 4 4
      src/utils/third-login.ts

+ 1 - 1
.env.production

@@ -1 +1 @@
-VITE_API_BASE=//t.ptcrepair.com.au
+VITE_API_BASE=/api

+ 4 - 4
src/utils/third-login.ts

@@ -10,7 +10,7 @@ window.fbAsyncInit = () => {
     version: 'v13.0',
   })
 
-  FB.getLoginStatus(statusChangeCallback)
+  // FB.getLoginStatus(statusChangeCallback)
 }
 
 function statusChangeCallback(response: any) {
@@ -28,7 +28,7 @@ function testAPI() {
   FB.api('/me?fields=id,name,email', function (response: any) {
     console.log(response)
     location.href =
-      'https://t.ptcrepair.com.au/user/facebook/callback?name=' +
+      'https://test.ptcrepair.com.au/api/user/facebook/callback?name=' +
       response.name +
       '&email=' +
       response.email
@@ -40,7 +40,7 @@ export function FBLogin() {
 }
 
 export function AppleLogin() {
-  location.href = 'https://t.ptcrepair.com.au/user/apple/login'
+  location.href = 'https://test.ptcrepair.com.au/api/user/apple/login'
 }
 
 export async function renderGoogleLoginButton(parent: HTMLElement) {
@@ -57,7 +57,7 @@ window.addEventListener('load', () => {
   google.accounts.id.initialize({
     client_id:
       '745604014349-1dthf8ni49l7313opmcicak5978evvfi.apps.googleusercontent.com',
-    login_uri: 'https://t.ptcrepair.com.au/user/google/callback',
+    login_uri: 'https://test.ptcrepair.com.au/api/user/google/callback',
     ux_mode: 'redirect',
   })
   gTask.done()