添加管理员权限
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bind_item">
|
||||
<!-- <div class="bind_item">
|
||||
<div class="title">{{ $t('frontPage.ModifyEmail') }}</div>
|
||||
<div class="box">
|
||||
<div class="type">
|
||||
@@ -40,7 +40,7 @@
|
||||
<div class="gallery_btn" @click="modifyEmail">{{ $t('frontPage.Modify') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="mark_loading" v-show="loadingShow">
|
||||
<a-spin size="large" />
|
||||
@@ -135,49 +135,52 @@ export default defineComponent({
|
||||
onMounted(async ()=>{
|
||||
let GOOGLE_CLIENT_ID = '194770296147-njd68pm7tnapgonkj2h48mhf63n15n3f.apps.googleusercontent.com'
|
||||
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=()=>{
|
||||
accountHomeData.googleLoad = true
|
||||
resolve()
|
||||
}
|
||||
script.onerror = ()=>{
|
||||
Modal.confirm({
|
||||
title: t('frontPage.jsContent2'),
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
okText: 'Yes',
|
||||
cancelText: 'No',
|
||||
mask:false,
|
||||
centered:true,
|
||||
onOk() {
|
||||
}
|
||||
});
|
||||
accountHomeData.googleLoad = true
|
||||
}
|
||||
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.getElementById("g_id_bind"),
|
||||
{
|
||||
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=()=>{
|
||||
accountHomeData.googleLoad = true
|
||||
resolve()
|
||||
}
|
||||
script.onerror = ()=>{
|
||||
Modal.confirm({
|
||||
title: t('frontPage.jsContent2'),
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
okText: 'Yes',
|
||||
cancelText: 'No',
|
||||
mask:false,
|
||||
centered:true,
|
||||
onOk() {
|
||||
}
|
||||
});
|
||||
accountHomeData.googleLoad = true
|
||||
}
|
||||
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.getElementById("g_id_bind"),
|
||||
{
|
||||
type:"icon",//icon为只有一个icon
|
||||
shape:"circle",
|
||||
theme:"outline",
|
||||
size:"large",
|
||||
logo_alignment:"center",
|
||||
}
|
||||
);
|
||||
}
|
||||
})
|
||||
onBeforeUnmount(()=>{
|
||||
var existingScript = document.querySelector(`script[src="${data.scriptSrc}"]`);
|
||||
|
||||
Reference in New Issue
Block a user