fix
This commit is contained in:
parent
d0773333ae
commit
96bd523f9e
BIN
hosta-admin-9.zip
Normal file
BIN
hosta-admin-9.zip
Normal file
Binary file not shown.
5
src/lib/tools/storages/auth-storage.js
Normal file
5
src/lib/tools/storages/auth-storage.js
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { StateStorage } from "../state-storage/StateStorage";
|
||||||
|
|
||||||
|
export const AuthStorage = new StateStorage({
|
||||||
|
logged: false
|
||||||
|
});
|
@ -16,16 +16,23 @@
|
|||||||
let value_role = "-1";
|
let value_role = "-1";
|
||||||
let value_bid = 0;
|
let value_bid = 0;
|
||||||
let value_trading = false;
|
let value_trading = false;
|
||||||
|
let value_currency_code = "-1";
|
||||||
|
|
||||||
$: checkFields(
|
$: checkFields(
|
||||||
value_name,
|
value_name,
|
||||||
value_surname,
|
value_surname,
|
||||||
value_balance,
|
value_balance,
|
||||||
value_role,
|
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) {
|
if (isStringEmptyOrSpaces(name) || name.length < 3) {
|
||||||
canCreateUser = false;
|
canCreateUser = false;
|
||||||
return;
|
return;
|
||||||
@ -38,7 +45,7 @@
|
|||||||
canCreateUser = false;
|
canCreateUser = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (role === "-1") {
|
if (role === "-1" || isStringEmptyOrSpaces(role)) {
|
||||||
canCreateUser = false;
|
canCreateUser = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -57,8 +64,11 @@
|
|||||||
|
|
||||||
async function createUser() {
|
async function createUser() {
|
||||||
loadingUserToken = true;
|
loadingUserToken = true;
|
||||||
const result = await makeGet(
|
const result = await makePost(
|
||||||
"createUser",
|
"createUser",
|
||||||
|
{
|
||||||
|
"code": value_currency_code
|
||||||
|
},
|
||||||
makeAuthHeaderForAxios(getAuthInfo()?.a)
|
makeAuthHeaderForAxios(getAuthInfo()?.a)
|
||||||
);
|
);
|
||||||
if (result.status === 401) {
|
if (result.status === 401) {
|
||||||
@ -157,6 +167,15 @@
|
|||||||
<option value="2">Модератор</option>
|
<option value="2">Модератор</option>
|
||||||
<option value="4">Администратор</option>
|
<option value="4">Администратор</option>
|
||||||
</select>
|
</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">
|
<div class="flex p-4 items-center gap-2">
|
||||||
<p>Торговля:</p>
|
<p>Торговля:</p>
|
||||||
<input
|
<input
|
||||||
|
@ -175,10 +175,18 @@
|
|||||||
<p class="font-bold">Имя и фамилия:</p>
|
<p class="font-bold">Имя и фамилия:</p>
|
||||||
<p class="text-info">{userData.name} {userData.surname}</p>
|
<p class="text-info">{userData.name} {userData.surname}</p>
|
||||||
</div>
|
</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">
|
<div class="flex gap-2 p-2 items-center text-lg">
|
||||||
<p class="font-bold">Баланс:</p>
|
<p class="font-bold">Баланс:</p>
|
||||||
<p class="text-info">{userData.balance} USDT</p>
|
<p class="text-info">{userData.balance} USDT</p>
|
||||||
</div>
|
</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">
|
<div class="flex gap-2 p-2 items-center text-lg">
|
||||||
<p class="font-bold">Ставка:</p>
|
<p class="font-bold">Ставка:</p>
|
||||||
<p class="text-info">{userData.bid} %</p>
|
<p class="text-info">{userData.bid} %</p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user