const axios = require('axios'); const Qs = require('qs'); function getAliyunDeviceSecret(url, deviceName) { var serve = axios({ url: url, method: 'post', baseURL: 'https://things.icoldchain.cn/', headers: { "Content-Type": "application/x-www-form-urlencoded", }, data: Qs.stringify({ isAutoRegister: 1, deviceName: deviceName }) }) return serve; } function getDevices(url, userClient, productCode) { var serve = axios({ url: url, method: 'post', baseURL: 'https://things.icoldchain.cn/', headers: { "Content-Type": "application/x-www-form-urlencoded", }, data: Qs.stringify({ client_code: userClient, product_code: productCode }) }) return serve; } module.exports = { getAliyunDeviceSecret, getDevices }