This commit is contained in:
yumoqing 2024-02-21 11:31:09 +08:00
parent 5221288224
commit cb58e8998e
2 changed files with 15 additions and 3 deletions

View File

@ -74,13 +74,13 @@ bricks.FormBody = class extends bricks.VBox {
var data = this.getValue(); var data = this.getValue();
this.dispatch('submit', data); this.dispatch('submit', data);
if (this.submit_url){ if (this.submit_url){
var jcall = bricks.jcall; var rc = new bricks.HttpResponse();
var rzt = await jcall(this.submit_url, var resp = await rc.httpcall(this.submit_url,
{ {
method:this.method || 'POST', method:this.method || 'POST',
params:data params:data
}); });
this.dispatch('submited', rzt); this.dispatch('submited', resp);
} }
} }

View File

@ -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 { bricks.HttpJson = class extends bricks.HttpText {
constructor(headers){ constructor(headers){
if (!headers) if (!headers)