打开域名详情页时如果所有者未实名,自动触发一次异步更新所有者信息
This commit is contained in:
parent
49adef8da3
commit
19e797382d
@ -194,6 +194,8 @@ export default {
|
|||||||
whoisProtectionLoading: false,
|
whoisProtectionLoading: false,
|
||||||
domainOwner: null,
|
domainOwner: null,
|
||||||
realNameStatus: 'unverified', // 实名认证状态:verified, unverified
|
realNameStatus: 'unverified', // 实名认证状态:verified, unverified
|
||||||
|
realNameSyncing: false, // 是否正在异步同步实名状态
|
||||||
|
triedSyncRealName: false, // 是否已尝试过触发一次实名状态同步,避免重复
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -265,6 +267,10 @@ export default {
|
|||||||
this.realNameStatus = 'verified';
|
this.realNameStatus = 'verified';
|
||||||
} else {
|
} else {
|
||||||
this.realNameStatus = 'unverified';
|
this.realNameStatus = 'unverified';
|
||||||
|
// 未实名时,页面打开后触发一次异步同步,随后刷新一次所有者信息
|
||||||
|
if (!this.triedSyncRealName) {
|
||||||
|
this.syncOwnerRealNameStatus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.realNameStatus = 'unverified';
|
this.realNameStatus = 'unverified';
|
||||||
@ -283,6 +289,34 @@ export default {
|
|||||||
this.realNameStatus = 'unverified';
|
this.realNameStatus = 'unverified';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 异步同步域名实名状态(仅触发一次)
|
||||||
|
async syncOwnerRealNameStatus() {
|
||||||
|
if (this.realNameSyncing || this.triedSyncRealName) return;
|
||||||
|
if (!this.$domain.pg?.domain) return;
|
||||||
|
this.triedSyncRealName = true;
|
||||||
|
this.realNameSyncing = true;
|
||||||
|
try {
|
||||||
|
const syncRequest = createResource({
|
||||||
|
url: 'jcloud.api.domain_west.sync_domain_info_from_west',
|
||||||
|
params: {
|
||||||
|
domain: this.$domain.pg.domain
|
||||||
|
},
|
||||||
|
onSuccess: () => {
|
||||||
|
this.realNameSyncing = false;
|
||||||
|
// 同步完成后刷新一次所有者信息
|
||||||
|
this.getDomainOwner();
|
||||||
|
},
|
||||||
|
onError: (error) => {
|
||||||
|
console.error('同步域名实名状态失败:', error);
|
||||||
|
this.realNameSyncing = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
syncRequest.submit();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('同步域名实名状态失败:', error);
|
||||||
|
this.realNameSyncing = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
renewDomain() {
|
renewDomain() {
|
||||||
const JsiteDomainRenewalDialog = defineAsyncComponent(() => import('./JsiteDomainRenewalDialog.vue'));
|
const JsiteDomainRenewalDialog = defineAsyncComponent(() => import('./JsiteDomainRenewalDialog.vue'));
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user