This commit is contained in:
you 2024-07-09 21:27:10 +03:00
parent d0773333ae
commit 96bd523f9e
4 changed files with 36 additions and 4 deletions

BIN
hosta-admin-9.zip Normal file

Binary file not shown.

View File

@ -0,0 +1,5 @@
import { StateStorage } from "../state-storage/StateStorage";
export const AuthStorage = new StateStorage({
logged: false
});

View File

@ -16,16 +16,23 @@
let value_role = "-1";
let value_bid = 0;
let value_trading = false;
let value_currency_code = "-1";
$: checkFields(
value_name,
value_surname,
value_balance,
value_role,
value_bid
value_bid,
value_currency_code
);
function checkFields(name, surname, balance, role, bid) {
function checkFields(name, surname, balance, role, bid, code) {
if(isStringEmptyOrSpaces(code) || code === "-1")
{
canCreateUser = false;
return;
}
if (isStringEmptyOrSpaces(name) || name.length < 3) {
canCreateUser = false;
return;
@ -38,7 +45,7 @@
canCreateUser = false;
return;
}
if (role === "-1") {
if (role === "-1" || isStringEmptyOrSpaces(role)) {
canCreateUser = false;
return;
}
@ -57,8 +64,11 @@
async function createUser() {
loadingUserToken = true;
const result = await makeGet(
const result = await makePost(
"createUser",
{
"code": value_currency_code
},
makeAuthHeaderForAxios(getAuthInfo()?.a)
);
if (result.status === 401) {
@ -157,6 +167,15 @@
<option value="2">Модератор</option>
<option value="4">Администратор</option>
</select>
<select
bind:value={value_currency_code}
class="select select-bordered w-full text-base"
>
<option disabled selected value="-1">Валюта</option>
<option value="KGS">KGS</option>
<!-- <option value="2">Модератор</option>
<option value="4">Администратор</option> -->
</select>
<div class="flex p-4 items-center gap-2">
<p>Торговля:</p>
<input

View File

@ -175,10 +175,18 @@
<p class="font-bold">Имя и фамилия:</p>
<p class="text-info">{userData.name} {userData.surname}</p>
</div>
<div class="flex gap-2 p-2 items-center text-lg">
<p class="font-bold">Валюта:</p>
<p class="text-info">{userData?.code}</p>
</div>
<div class="flex gap-2 p-2 items-center text-lg">
<p class="font-bold">Баланс:</p>
<p class="text-info">{userData.balance} USDT</p>
</div>
<div class="flex gap-2 p-2 items-center text-lg">
<p class="font-bold">Заморожено:</p>
<p class="text-info">{userData?.insurance}</p>
</div>
<div class="flex gap-2 p-2 items-center text-lg">
<p class="font-bold">Ставка:</p>
<p class="text-info">{userData.bid} %</p>