zoukankan      html  css  js  c++  java
  • react native 网络get请求方式参数不可为undefined或null

    react native 网络get请求方式参数不可为undefined(为空的话默认变为)或null

    错误写法:

    export function addToCartAction(isRefreshing, loading, spId, number, spfId = null, pgId = null) {
        console.warn('==>',spId+":"+number);
        return  (isRefreshing || loading) ? 
            {types: [FETCH_ADD_TO_CART.code, SUCCESS_ADD_TO_CART, FAILURE_ADD_TO_CART],
                callAPI: () => request(FETCH_ADD_TO_CART.url+'?spId='+spId+'&number='+number+'&spfId='+spfId+'&pgId='+pgId),
                payload: {isRefreshing, loading}
            } : {type: CLEAR_ADD_TO_CART, isRefreshing, loading};
    }

    正确写法:

    export function addToCartAction(isRefreshing, loading, spId, number) {
        console.warn('==>',spId+":"+number);
        return  (isRefreshing || loading) ? 
            {types: [FETCH_ADD_TO_CART.code, SUCCESS_ADD_TO_CART, FAILURE_ADD_TO_CART],
                callAPI: () => request(FETCH_ADD_TO_CART.url+'?spId='+spId+'&number='+number),
                payload: {isRefreshing, loading}
            } : {type: CLEAR_ADD_TO_CART, isRefreshing, loading};
    }
  • 相关阅读:
    cloud_config学习_2
    layui的tab和form冲突
    layui+beetl实现三级菜单
    postgreSQL官网教程_管理表、类型
    08、异 常&包
    07、面向对象特征之多态&内部类
    06、面向对象特征之继承
    04、面向对象
    03、数组&内存划分
    02、函数
  • 原文地址:https://www.cnblogs.com/luoxiaolei/p/5865301.html
Copyright © 2011-2022 走看看