fix
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
<span>{{ $props.text }}</span>
|
||||
</div>
|
||||
<div class="g_id_signin" id="g_id_signin">
|
||||
<img src="@/assets/images/loginPage/gmailIcon.svg" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -38,34 +37,37 @@
|
||||
// 使用谷歌登录的api
|
||||
const createGmailLogin = async ()=>{
|
||||
var existingScript = document.querySelector(`script[src="${data.scriptSrc}"]`);
|
||||
if(!existingScript){
|
||||
await new Promise((resolve, reject) => {
|
||||
const script = document.createElement("script");
|
||||
script.src = data.scriptSrc
|
||||
script.onload=()=>{
|
||||
resolve()
|
||||
}
|
||||
document.body.appendChild(script);
|
||||
})
|
||||
}
|
||||
window.google.accounts.id.initialize({
|
||||
// 主要就是填写client_id
|
||||
client_id: GOOGLE_CLIENT_ID,
|
||||
auto_select: false,
|
||||
callback: handleCredentialResponse,
|
||||
// context:"signin",
|
||||
ux_mode:"popup",
|
||||
itp_support:true,
|
||||
});
|
||||
window.google.accounts.id.renderButton(
|
||||
document.querySelector('.Container #g_id_signin'),
|
||||
{
|
||||
type:"icon",//icon为只有一个icon
|
||||
shape:"circle",
|
||||
theme:"outline",
|
||||
size:"large",
|
||||
logo_alignment:"center",
|
||||
if(!window.isAddGmail){
|
||||
if(!existingScript){
|
||||
window.isAddGmail = true
|
||||
await new Promise((resolve, reject) => {
|
||||
const script = document.createElement("script");
|
||||
script.src = data.scriptSrc
|
||||
script.onload=()=>{
|
||||
resolve()
|
||||
}
|
||||
document.body.appendChild(script);
|
||||
})
|
||||
}
|
||||
window.google.accounts.id.initialize({
|
||||
// 主要就是填写client_id
|
||||
client_id: GOOGLE_CLIENT_ID,
|
||||
auto_select: false,
|
||||
callback: handleCredentialResponse,
|
||||
// context:"signin",
|
||||
ux_mode:"popup",
|
||||
itp_support:true,
|
||||
});
|
||||
window.google.accounts.id.renderButton(
|
||||
document.querySelector('.Container #g_id_signin'),
|
||||
{
|
||||
type:"icon",//icon为只有一个icon
|
||||
shape:"circle",
|
||||
theme:"outline",
|
||||
size:"large",
|
||||
logo_alignment:"center",
|
||||
});
|
||||
}
|
||||
}
|
||||
onBeforeUnmount(()=>{
|
||||
var existingScript = document.querySelector(`script[src="${data.scriptSrc}"]`);
|
||||
@@ -133,7 +135,7 @@
|
||||
.S9gUrf-YoZ4jf{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
iframe{
|
||||
:deep(iframe){
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
margin: 0 !important;
|
||||
|
||||
@@ -1010,7 +1010,7 @@ export default defineComponent({
|
||||
}
|
||||
.thirdPartyLogin{
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
// justify-content: flex-start;
|
||||
> div{
|
||||
position: relative;
|
||||
margin-right: 1rem;
|
||||
|
||||
Reference in New Issue
Block a user