This repository has been archived on 2024-10-02. You can view files and clone it, but cannot push or open issues or pull requests.
smart-tag/doc/4batchDelete.js

35 lines
963 B
JavaScript
Raw Normal View History

2021-03-10 15:27:43 +00:00
const express = require('express');
const got = require('got');
const config = require('./config');
const app = express();
const port = 9999;
app.get('/', async(req, res) => {
(async() => {
2021-03-18 10:38:05 +00:00
const info = await config.info;
2021-03-10 15:27:43 +00:00
let key = info.data.token;
(async() => {
2021-03-18 10:38:05 +00:00
const {body} = await got.delete('http://app.etiquetaselectronicas.com:9999/item/batchDeleteItem', {
2021-03-10 15:27:43 +00:00
json: {
storeId: config.storeId,
list: [
2021-03-18 10:38:05 +00:00
'2000123456',
'5141415414312'
2021-03-10 15:27:43 +00:00
]
},
responseType: 'json',
headers: {
2021-03-18 10:38:05 +00:00
'Authorization': key
2021-03-10 15:27:43 +00:00
}
2021-03-18 10:38:05 +00:00
});
console.log(body);
res.end(JSON.stringify(body));
2021-03-10 15:27:43 +00:00
})();
})();
});
app.listen(port, () => {
2021-03-18 10:38:05 +00:00
console.log(`Example app listening at http://localhost:${port}`);
});