From cc5f449dd9b81e0f9d1e30d1de53096612679e1e Mon Sep 17 00:00:00 2001 From: jingrow Date: Wed, 6 Aug 2025 01:45:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=BE=91=E6=89=80?= =?UTF-8?q?=E6=9C=89=E8=80=85=E6=A8=A1=E6=9D=BF=E5=90=8E=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dashboard/src2/components/DomainOwner.vue | 3 ++- jcloud/api/domain_west.py | 10 +++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dashboard/src2/components/DomainOwner.vue b/dashboard/src2/components/DomainOwner.vue index 437a059..99ff06f 100644 --- a/dashboard/src2/components/DomainOwner.vue +++ b/dashboard/src2/components/DomainOwner.vue @@ -754,8 +754,9 @@ export default { } else { console.error('更新失败 - response:', response); toast.error(response.message || '更新失败'); - this.editLoading = false; } + // 确保在所有情况下都重置 loading 状态 + this.editLoading = false; }, onError: (error) => { console.error('=== onError 回调 ==='); diff --git a/jcloud/api/domain_west.py b/jcloud/api/domain_west.py index 3c4dfa0..e5779ad 100644 --- a/jcloud/api/domain_west.py +++ b/jcloud/api/domain_west.py @@ -499,7 +499,10 @@ class WestDomain: **template_data } - return self._make_request('/audit/', 'POST', body_params=body_params) + # 对body_params进行GBK编码 + encoded_data = urlencode(body_params, encoding='gbk').encode('gbk') + + return self._make_request('/audit/', 'POST', body_params=encoded_data) def get_domain_real_info(self, domain: str) -> Dict[str, Any]: """ @@ -3316,9 +3319,10 @@ def update_domain_owner(name, **data): jingrow.log_error("update_domain_owner", f"更新的字段: {updated_fields}") - # 保存更新 + # 保存更新,使用 ignore_permissions=True 忽略权限检查 jingrow.log_error("update_domain_owner", "正在保存本地更新...") - domain_owner.save() + domain_owner.save(ignore_permissions=True) + jingrow.db.commit() jingrow.log_error("update_domain_owner", "本地记录保存成功") return {