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