fix jss 0.146
This commit is contained in:
@@ -4,7 +4,7 @@ function getToken() {
|
|||||||
function tokenCheck(){
|
function tokenCheck(){
|
||||||
const token = getToken();
|
const token = getToken();
|
||||||
if (token) {
|
if (token) {
|
||||||
window.location.href = "http://localhost:5500/server/frontend/main/index.html";
|
window.location.href = "https://ru.homyk.space/main";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
document.getElementById('loginForm').addEventListener('submit', async function (e) {
|
document.getElementById('loginForm').addEventListener('submit', async function (e) {
|
||||||
@@ -14,7 +14,7 @@ document.getElementById('loginForm').addEventListener('submit', async function (
|
|||||||
password
|
password
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
const response = await fetch("http://localhost:8000/api/auth", {
|
const response = await fetch("https://ru.homyk.space/api/auth", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/x-www-form-urlencoded",
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
@@ -29,7 +29,7 @@ document.getElementById('loginForm').addEventListener('submit', async function (
|
|||||||
// в sessionstorage до перезахода в браузер(
|
// в sessionstorage до перезахода в браузер(
|
||||||
sessionStorage.setItem("token", data.access_token);
|
sessionStorage.setItem("token", data.access_token);
|
||||||
|
|
||||||
window.location.href = 'http://localhost:5500/server/frontend/main/index.html';
|
window.location.href = 'https://ru.homyk.space/main';
|
||||||
} else { //парсинг и вывод ошибок, если есть
|
} else { //парсинг и вывод ошибок, если есть
|
||||||
if (Array.isArray(data.detail)) {
|
if (Array.isArray(data.detail)) {
|
||||||
const messages = data.detail.map(e => {
|
const messages = data.detail.map(e => {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ function getToken() {
|
|||||||
function tokenCheck(){
|
function tokenCheck(){
|
||||||
const token = getToken();
|
const token = getToken();
|
||||||
if (!token) {
|
if (!token) {
|
||||||
window.location.href = "http://localhost:5500/server/frontend/auth/login.html";
|
window.location.href = "https://ru.homyk.space";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user