1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
| 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 }
|
|