wip
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 33s

This commit is contained in:
2026-03-25 21:58:45 +03:00
parent 40370bab2c
commit 107e454589
5 changed files with 10 additions and 4 deletions

3
.env
View File

@@ -1 +1,2 @@
BASE_URL=https://chat.madsky.ru
VITE_API_URL=https://chat.madsky.ru
VITE_WS_URL=ws://localhost:3000

2
.env.production Normal file
View File

@@ -0,0 +1,2 @@
VITE_API_URL=https://chat.madsky.ru
VITE_WS_URL=ws://localhost:3000

View File

@@ -7,6 +7,9 @@ export const useAuthStore = defineStore('auth', () => {
const me = ref<User>()
async function login(email: string) {
const baseUrl = import.meta.env.VITE_API_URL
console.log(baseUrl)
try {
const options = {
method: 'POST',
@@ -15,7 +18,7 @@ export const useAuthStore = defineStore('auth', () => {
},
body: JSON.stringify({ email: email }),
}
const res = await fetch('http://localhost:5173/api/login', options)
const res = await fetch(baseUrl + '/api/login', options)
if (res.ok) {
const data: { accessToken: string; refreshToken: string } = await res.json()

View File

@@ -32,7 +32,7 @@ export enum COMMAND {
}
export const useSocketsStore = defineStore('sockets', () => {
const url = 'ws://localhost:3000/ws'
const url = import.meta.env.WS_URL + '/ws'
const authStore = useAuthStore()
const chatsStore = useChatsStore()

View File

@@ -14,7 +14,7 @@ export default defineConfig({
},
},
server: {
host: true,
// host: true,
port: 5173,
strictPort: true,
proxy: {