first commit
This commit is contained in:
10
server/comman/mqttaxios.js
Normal file
10
server/comman/mqttaxios.js
Normal file
@ -0,0 +1,10 @@
|
||||
const myaxios = require('axios');
|
||||
myaxios.defaults.baseURL = 'http://82.156.1.111:18083';
|
||||
const mqtusername = 'admin';
|
||||
const mqtpassword = 'licahk';
|
||||
const input = mqtusername+":"+mqtpassword;
|
||||
const token = Buffer.from(input).toString('base64');
|
||||
//console.log(token);
|
||||
myaxios.defaults.headers.common['Authorization'] = 'Basic ' + token;
|
||||
|
||||
module.exports = myaxios
|
Reference in New Issue
Block a user