一.实体传参
1.前端VUE写法
<script setup lang="ts" >
import axios from 'axios'
const SetParameter = async (Name: any, Val: any) => {
let pa = { Name: Name, Value: Val }
axios.post(global_const.WEBAPI + `Hanslaser/SetParameter`, pa).then(response => {
}).catch(err => {
})
}
2.后端webapi
/// <summary>
/// 设置激光打标参数
/// </summary>
/// <param name="Name"></param>
/// <param name="val"></param>
[HttpPost(Name = "SetParameter")]
public int SetParameter(ParamModel pm)
{
return SqliteHelper.SetParamter(pm.Name, pm.Value);
}