|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="p-login">
|
|
|
+ <div ref="root" class="p-login">
|
|
|
<router-link class="nav-home" to="/">
|
|
|
<i class="icon"></i><span class="text">HOME</span>
|
|
|
</router-link>
|
|
@@ -43,7 +43,14 @@
|
|
|
<div class="alternative">
|
|
|
<div class="delimiter">Or sign in with</div>
|
|
|
<ul class="list">
|
|
|
- <li ref="gSignin" class="item" name="google"></li>
|
|
|
+ <li
|
|
|
+ class="item g_id_signin"
|
|
|
+ name="google"
|
|
|
+ data-type="icon"
|
|
|
+ data-shape="circle"
|
|
|
+ data-theme="filled_black"
|
|
|
+ data-width="40"
|
|
|
+ ></li>
|
|
|
<li class="item" name="facebook" @click="FBLogin"></li>
|
|
|
<li class="item" name="apple" @click="AppleLogin"></li>
|
|
|
</ul>
|
|
@@ -54,6 +61,12 @@
|
|
|
and acknowledged PTC’s <span class="primary">privacy policy</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div
|
|
|
+ id="g_id_onload"
|
|
|
+ data-client_id="393349837160-3opoqoo9l0gk9uimu212gp9uvm72406m.apps.googleusercontent.com"
|
|
|
+ data-login_uri="https://test.ptcrepair.com.au/api/user/google/callback"
|
|
|
+ data-auto_prompt="false"
|
|
|
+ ></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -68,7 +81,7 @@ import Toast from '@/components/toast'
|
|
|
import {
|
|
|
FBLogin,
|
|
|
AppleLogin,
|
|
|
- renderGoogleLoginButton,
|
|
|
+ // renderGoogleLoginButton,
|
|
|
} from '@/utils/third-login'
|
|
|
|
|
|
const router = useRouter()
|
|
@@ -79,9 +92,14 @@ const { values, handleSubmit } = useForm<ApiUser.Login.Request>({
|
|
|
password: string().required(),
|
|
|
},
|
|
|
})
|
|
|
-const gSignin = ref<HTMLElement>()
|
|
|
+const root = ref<HTMLElement>()
|
|
|
|
|
|
-onMounted(() => renderGoogleLoginButton(gSignin.value!))
|
|
|
+// onMounted(() => renderGoogleLoginButton(gSignin.value!))
|
|
|
+onMounted(() => {
|
|
|
+ const s = document.createElement('script')
|
|
|
+ s.src = 'https://accounts.google.com/gsi/client'
|
|
|
+ root.value!.appendChild(s)
|
|
|
+})
|
|
|
|
|
|
async function handleLogin() {
|
|
|
const { message } = await login(values as any)
|