📜  llamar a un segundo back - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:34.851000             🧑  作者: Mango

代码示例1
var var1
var var2
try{
      await unirest
        .get( Env.get('REST_VPN') + '/yourURL?name='+name)
        .then(function(response){
          const json = JSON.parse(response.body.data)
          var1 = json.subjectId
          var2 = json.courseName        
        })
        const result = await Database.table('yourTable').where('name',name).update({ column1:va1,column2:var2  })

    } catch (err) {
      console.log('missing name')      
    }