东丽网口版透析机 socket- server 通讯
chenyc
2025-12-09 7cfe3332f016d7def7ca8ad25ed8bbdc33d23ed2
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
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 }