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();
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);
}
}

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 {
constructor(headers){
if (!headers)