3***@qq.com
3***@qq.com
  • 发布:2020-05-29 10:42
  • 更新:2020-05-29 10:42
  • 阅读:687

POST方式提交数据。后台收不到

分类:uni-app
uni app 代码  
var cash = {  
                    Ids: orders,  
                    Money: money,  
                    UserId: this.user.id  
                }  
                uni.request({  
                    url: 'http://111.67.207.125:5001/api/HappyBook/GetMoeny',  
                    method: 'POST',  
                    data: {  
                        "cash": JSON.stringify(cash)  
                    },  
                    header: {  
                        'content-type': 'application/json'  
                    },  
                    success: (e) => {  
                        console.log(e);  
                    },  
                    fail: (e) => {  
                        console.log(e);  
                    }  
                })
c# 代码  
 [HttpPost]  
        public ActionResult<dynamic> GetMoeny(CashOut cash)  
        {  
            try  
            {  
                string oIds = cash.Ids.Substring(0, cash.Ids.Length - 2);  
                string[] arrOrders = oIds.Split(',');  
                DBContext dB = new DBContext();  
                dB.GetMoeny(arrOrders);  
                return "ok";  
            }  
            catch (Exception ex)  
            {  
                return ex.Message + ex.StackTrace + ex.Source;  
            }  

        }
2020-05-29 10:42 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复