diff --git a/dashboard/src2/components/JsiteDomainOverview.vue b/dashboard/src2/components/JsiteDomainOverview.vue index f116768..01f97f7 100644 --- a/dashboard/src2/components/JsiteDomainOverview.vue +++ b/dashboard/src2/components/JsiteDomainOverview.vue @@ -194,6 +194,8 @@ export default { whoisProtectionLoading: false, domainOwner: null, realNameStatus: 'unverified', // 实名认证状态:verified, unverified + realNameSyncing: false, // 是否正在异步同步实名状态 + triedSyncRealName: false, // 是否已尝试过触发一次实名状态同步,避免重复 }; }, @@ -265,6 +267,10 @@ export default { this.realNameStatus = 'verified'; } else { this.realNameStatus = 'unverified'; + // 未实名时,页面打开后触发一次异步同步,随后刷新一次所有者信息 + if (!this.triedSyncRealName) { + this.syncOwnerRealNameStatus(); + } } } else { this.realNameStatus = 'unverified'; @@ -283,6 +289,34 @@ export default { 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() { const JsiteDomainRenewalDialog = defineAsyncComponent(() => import('./JsiteDomainRenewalDialog.vue'));