последняя рабочая версия

This commit is contained in:
IoT Manager
2023-10-06 23:54:58 +02:00
parent 147618463f
commit 70264cefc8
2 changed files with 7 additions and 31 deletions

View File

@@ -7,9 +7,9 @@
<title>IoT Manager 4.5.1</title> <title>IoT Manager 4.5.1</title>
<link rel="icon" type="image/png" href="/favicon.ico" /> <link rel="icon" type="image/png" href="/favicon.ico" />
<link rel="stylesheet" href="/build/bundle.css?451" /> <link rel="stylesheet" href="/build/bundle.css?4511" />
<script defer src="/build/bundle.js?451"></script> <script defer src="/build/bundle.js?4511"></script>
</head> </head>
<body></body> <body></body>

View File

@@ -104,42 +104,18 @@
} }
}; };
//иногда не отправляет токен - непонятно почему
//const placeOrder = async () => {
// delete myProfileJson["_id"];
// const JWT = Cookies.get("token_iotm2");
// try {
// let res = await fetch("https://portal.iotmanager.org/compiler/order", {
// mode: "cors",
// method: "POST",
// headers: {
// "Content-Type": "application/json",
// Authorization: `Bearer ${JWT}`,
// },
// body: JSON.stringify(myProfileJson),
// });
// const content = await res.json();
// if (res.ok) {
// errors = [{ msg: "ok_success" }];
// await getUserBuilds();
// console.log(content.message);
// } else {
// errors = content.message;
// }
// } catch (e) {
// console.log(e);
// }
//};
//временно используем без jwt
const placeOrder = async () => { const placeOrder = async () => {
delete myProfileJson["_id"]; delete myProfileJson["_id"];
//добавим в тело имя пользователя
myProfileJson.username = userdata.username;
const JWT = Cookies.get("token_iotm2");
try { try {
let res = await fetch("https://portal.iotmanager.org/compiler/esporder", { let res = await fetch("https://portal.iotmanager.org/compiler/order", {
mode: "cors", mode: "cors",
method: "POST", method: "POST",
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
Authorization: `Bearer ${JWT}`,
}, },
body: JSON.stringify(myProfileJson), body: JSON.stringify(myProfileJson),
}); });