From cb58e8998e8c2e70fde9e7b0c330f19608a6a39b Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 21 Feb 2024 11:31:09 +0800 Subject: [PATCH] bugfix --- bricks/form.js | 6 +++--- bricks/jsoncall.js | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/bricks/form.js b/bricks/form.js index 7a11bf0..a9255f8 100644 --- a/bricks/form.js +++ b/bricks/form.js @@ -74,13 +74,13 @@ bricks.FormBody = class extends bricks.VBox { var data = this.getValue(); this.dispatch('submit', data); if (this.submit_url){ - var jcall = bricks.jcall; - var rzt = await jcall(this.submit_url, + var rc = new bricks.HttpResponse(); + var resp = await rc.httpcall(this.submit_url, { method:this.method || 'POST', params:data }); - this.dispatch('submited', rzt); + this.dispatch('submited', resp); } } diff --git a/bricks/jsoncall.js b/bricks/jsoncall.js index 8041329..4be50e3 100755 --- a/bricks/jsoncall.js +++ b/bricks/jsoncall.js @@ -171,6 +171,18 @@ bricks.HttpText = class { } } +bricks.HttpResponse = class extends bricks.HttpText { + async get_result_data(resp){ + return resp; + } +} + +bricks.HttpRaw = class extends bricks.HttpText { + async get_result_data(resp){ + return await resp.blob(); + } +} + bricks.HttpJson = class extends bricks.HttpText { constructor(headers){ if (!headers)