//写入数据-- adddata() { wx.request({ ...
//写入数据--
adddata() {
wx.request({
url: 'https://cloud.huaxio.cn/userfile/sqlapi/getapi.php',
data: {
apiname: '', //接口名称
apipswd: '', //接口密码
getysql: '' //执行语句
},
method: 'post',
header: {
"Content-Type": "application/x-www-form-urlencoded"
},
dataType: 'json',
responseType: 'text',
success: (res) => {
console.log(res.data)
},
fail: () => {},
complete: () => {}
})
},
//删除数据
deldata() {
wx.request({
url: 'https://cloud.huaxio.cn/userfile/sqlapi/getapi.php',
data: {
apiname: '', //接口名称
apipswd: '', //接口密码
getysql: '' //执行语句
},
method: 'post',
header: {
"Content-Type": "application/x-www-form-urlencoded"
},
dataType: 'json',
responseType: 'text',
success: (res) => {
console.log(res.data)
},
fail: () => {},
complete: () => {}
})
},
//更新数据
unpdata() {
wx.request({
url: 'https://cloud.huaxio.cn/userfile/sqlapi/getapi.php',
data: {
apiname: '', //接口名称
apipswd: '', //接口密码
getysql: '' //执行语句
},
method: 'post',
header: {
"Content-Type": "application/x-www-form-urlencoded"
},
dataType: 'json',
responseType: 'text',
success: (res) => {
console.log(res.data)
},
fail: () => {},
complete: () => {}
})
},
//查询数据
secdata() {
wx.request({
url: 'https://cloud.huaxio.cn/userfile/sqlapi/getapi.php',
data: {
apiname: '', //接口名称
apipswd: '', //接口密码
getysql: '' //执行语句
},
method: 'post',
header: {
"Content-Type": "application/x-www-form-urlencoded"
},
dataType: 'json',
responseType: 'text',
success: (res) => {
// console.log(res.data.result[2]['data1'])
console.log(res.data)
},
fail: () => {},
complete: () => {}
})
},