This commit is contained in:
Владимир Фёдоров 2025-05-18 22:59:20 +07:00
parent 02c5451c5b
commit 75c11b36a6
3 changed files with 17 additions and 17 deletions

View File

@ -1,7 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, nextTick, watch, onMounted } from 'vue'; import { ref, nextTick, watch, onMounted } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { host } from './net';
const router = useRouter(); const router = useRouter();
@ -28,7 +27,7 @@
function getTeam() { function getTeam() {
fetch( fetch(
host+"/team", "/team",
{ {
method: "GET", method: "GET",
headers: { headers: {
@ -52,7 +51,9 @@
} }
function addAction() { function addAction() {
fetch(host+"/team/actions", { fetch(
"/team/actions",
{
method: "POST", method: "POST",
headers: { headers: {
"X-Id": sessionStorage.getItem("teamId") || "", "X-Id": sessionStorage.getItem("teamId") || "",
@ -61,7 +62,8 @@
body: JSON.stringify({ body: JSON.stringify({
"place": place.value "place": place.value
}) })
}) }
)
.then(async () => {place.value = ""}) .then(async () => {place.value = ""})
} }

View File

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref } from 'vue';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { host } from './net';
const router = useRouter(); const router = useRouter();
const login = ref("") const login = ref("")
@ -14,7 +14,7 @@
buttonText.value = "Загрузка..." buttonText.value = "Загрузка..."
errorMsg.value = "" errorMsg.value = ""
fetch( fetch(
host+"/team", "/team",
{ {
method: "GET", method: "GET",
headers: { headers: {
@ -34,7 +34,7 @@
} }
}) })
.catch(() => { .catch(() => {
errorMsg.value = "Сервер не доступен " + host errorMsg.value = "Сервер не доступен"
}) })
.finally(() => {buttonText.value = oldText}); .finally(() => {buttonText.value = oldText});
} }

View File

@ -1,2 +0,0 @@
export const host = "http://0.0.0.0:8090"
// export const host = "http://192.168.0.110:8090"