The problem of passing parameters in vue axios

the front end needs to pass two parameters to the backend, one id, and one type,. I encapsulated these two parameters into an object and each time the id failed to pass. If it is not encapsulated, how can I pass the two parameters to the backend (the id comes from I click on a line of a table and the id,type is the defined type)

Jun.02,2021

Let's take a look at the specific code


only id failed? Did you click to get id


in this way, if it is a get request:

const params = {
  id:id,
  type:type  
}
axios.get('api',{params}).then((res)=>{
},(err)=>{
})

if it is a post request:

const params = {
  id:id,
  type:type  
}
axios.get('api',params).then((res)=>{
},(err)=>{
})
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b39dc8-2af0e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b39dc8-2af0e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?