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;
}
}
0 个回复