fix api url

This commit is contained in:
Martin Araneda 2023-03-01 23:55:56 -03:00
parent 630ad3a94f
commit 5e0eca4b1e
6 changed files with 6 additions and 6 deletions

View File

@ -8,7 +8,7 @@ import jwt_decode from 'jwt-decode';
import auth from '../utils/Auth';
const url = new URL(window.location.href);
const api = (url.port == "5173") ? "http://localhost:3001" : "/api";
const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1";
const { onMenuToggle } = useLayout();
const outsideClickListener = ref(null);
const topbarMenuActive = ref(false);

View File

@ -13,7 +13,7 @@ var auth = {
},
checkToken(redirect = true, callback = null) {
const url = new URL(window.location.href);
const api = (url.port == "5173") ? "http://localhost:3001" : "/api";
const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1";
const config = this.getTokenHeader();

View File

@ -25,7 +25,7 @@ const setColorOptions = () => {
surfaceBorder = documentStyle.getPropertyValue('--surface-border');
};
const url = new URL(window.location.href);
const api = (url.port == "5173") ? "http://localhost:3001" : "/api";
const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1";
async function getGames() {

View File

@ -8,7 +8,7 @@ const password = ref('');
const router = useRouter();
const toast = useToast();
const url = new URL(window.location.href);
const api = (url.port == "5173") ? "http://localhost:3001" : "/api";
const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1";
async function onLoginClick() {
var login =

View File

@ -20,7 +20,7 @@ const checkAuth = () => {
auth.checkToken(true);
};
const url = new URL(window.location.href);
const api = (url.port == "5173") ? "http://localhost:3001" : "/api";
const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1";
async function showTable() {
try {

View File

@ -20,7 +20,7 @@ const checkAuth = () => {
auth.checkToken(true);
};
const url = new URL(window.location.href);
const api = (url.port == "5173") ? "http://localhost:3001" : "/api";
const api = (url.port == "5173") ? "http://localhost:3001" : "/api/v1";
async function showTable() {
try {