Vue3 axios get 参数问题

 WEBAPI controller代码

        /// 
        /// 
        /// 
        /// 
        [HttpGet(Name = "GetShelvesControllerIP")]
        public string GetShelvesControllerIP(string ShelvesNo)
        {
            List shelves1Model = new List();

            shelves1Model = shouhangdb.Shelves1.GetShelves(ShelvesNo);
            if (shelves1Model.Count > 0)
            {
                return shelves1Model.FirstOrDefault().ControllerIP;
            }
            else
            {
                return "--";
            } 
        }

 vue3 axios 代码

let SetShelvesNo = async () => {

	//let pm1 = { ShelvesNo: ShelvesNo.value }
	//console.log(pm1);
	let url = global_const.WEBAPI + `System/GetShelvesControllerIP`
	let s = await axios.get(url, { params: {ShelvesNo: ShelvesNo.value } })
		.then(function (response) {
			console.log('SetShelvesNo ok' + ShelvesNo);
			console.log(response);

			return response.data;
		})
		.catch(function (error) {
			console.log(error);
		});
	console.log("end SetShelvesNo " + s)
	return s;
}

你可能感兴趣的:(#,axios,javascript,前端,vue.js)