mirror of
https://github.com/lasthead0/yandex2mqtt.git
synced 2025-08-08 09:01:00 +03:00
test
This commit is contained in:
@@ -25,18 +25,20 @@ module.exports.devices = [
|
||||
try {
|
||||
const ltoken = global.authl.findOne({'token': authToken});
|
||||
const {userId} = ltoken;
|
||||
console.log(userId);
|
||||
|
||||
const r = {
|
||||
request_id: reqId,
|
||||
payload: {
|
||||
user_id: "1",
|
||||
user_id: userId,
|
||||
devices: []
|
||||
}
|
||||
};
|
||||
|
||||
for (const d of global.devices) {
|
||||
r.payload.devices.push(d.getInfo());
|
||||
if (Array.isArray(d.users) && d.users.indexOf(userId)) {
|
||||
console.log(d.getInfo());
|
||||
r.payload.devices.push(d.getInfo());
|
||||
}
|
||||
};
|
||||
|
||||
res.status(200).send(r);
|
||||
|
Reference in New Issue
Block a user