Commit 8aff44afd131dcbb7c7fcb774709384711614302

Authored by xp.Huang
2 parents 28dd094a 81a8063b

Merge branch 'ft_local_dev' into 'main'

fix:新增租户管理员点击确定按钮,服务端未响应数据导致按钮loading消失

See merge request huang/yun-teng-iot-front!432
... ... @@ -144,8 +144,8 @@
144 144 const getTitle = computed(() => (!unref(isUpdate) ? '新增租户管理员' : '编辑租户管理员'));
145 145
146 146 async function handleSubmit() {
147   - setDrawerProps({ confirmLoading: true });
148 147 try {
  148 + setDrawerProps({ confirmLoading: true });
149 149 const values = await validate();
150 150 const requestParams = {
151 151 id: values.id,
... ... @@ -160,15 +160,16 @@
160 160 : null,
161 161 tenantId: tenantId.value,
162 162 };
163   - saveTenantAdmin(requestParams as any as UserDTO).then(() => {
164   - closeDrawer(); //关闭侧框
165   - emit('success');
166   - });
167   - } finally {
168   - setTimeout(() => {
169   - setDrawerProps({ confirmLoading: false });
170   - }, 300);
171   - }
  163 + saveTenantAdmin(requestParams as any as UserDTO)
  164 + .then(() => {
  165 + closeDrawer(); //关闭侧框
  166 + emit('success');
  167 + setDrawerProps({ confirmLoading: false });
  168 + })
  169 + .catch(() => {
  170 + setDrawerProps({ confirmLoading: false });
  171 + });
  172 + } catch {}
172 173 }
173 174
174 175 return {
... ...