|
async toFetch() {
// nativeFetch.fetch({
// url: '${domain}/movies/get',
// method: 'GET',
// success: (data) => {
// this.testCode = 'sucess!'
// this.testData = JSON.parse(data.data).data
// },
// fail: (data, code) => {
// this.testCode = 'fail'
// console.error(data, code) },
// complete: () => { this.testCode = 'complete' }
// })
try {
const data = await nativeFetch.fetch({
url: 'http://192.168.31.229:3000/movies/get',
method: 'GET',
})
console.log('sucesssssssssssssssssssssssssssssssssssssssssssssssss')
this.testCode = 'sucess!'
this.testData = JSON.parse(data.data.data).data
} catch (e) {
this.testCode = 'fail!'
console.log('failllllllllllllllllllllllllllllllllllllllllllllllllllllll')
//console.error(e)
}
},
|
|