fetch通信方式参数模型 FetchModel

1.说明

后端通信标准格式

2.参数顺序

constructor(url,success,params=null,error=null,type="GET")

3.API

参数名 默认值 参数说明
url null 后端接口请求地址
params null 参数
success null 请求成功事件,如果调用then方法时该属性要有返回值以便进行下一步操作或者不设置)
error null 请求失败事件
type GET 通信类型,专门用于then方法

4.代码演示

    let url = alogUtil.orderUrl() + "/sell-portal/saleorder/copyAddSO.htm" + alogUtil.getOMSParams();
    let fetchModel = new FetchModel(url, this.copyAddSaleOrderSuccess, saleOrder, this.Error);
    alogUtil.fetch.post(fetchModel);

    copyAddSaleOrderSuccess:function (data) {

    },
    Error: function (errorCode, errorMessage) {//统一的错误处理
        Message.error("操作失败,原因:"  + errorMessage);
    },

results matching ""

    No results matching ""