add config cicd
Some checks failed
Deploy on Master Change / deploy (push) Failing after 15s

This commit is contained in:
2026-07-01 07:39:55 +07:00
parent 7b3f29ee73
commit 42fc2d9136
4 changed files with 84 additions and 6 deletions

View File

@@ -1,4 +1,19 @@
const API_BASE = 'http://127.0.0.1:8080/api';
export const API_BASE = import.meta.env.VITE_API_BASE || 'http://127.0.0.1:8080/api';
export function getWsUrl(path: string): string {
try {
if (API_BASE.startsWith('http://') || API_BASE.startsWith('https://')) {
const url = new URL(API_BASE);
const protocol = url.protocol === 'https:' ? 'wss:' : 'ws:';
return `${protocol}//${url.host}${path}`;
}
} catch (e) {
// ignore
}
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
return `${protocol}//${window.location.host}${path}`;
}
function getToken(): string | null {
return localStorage.getItem('sc_staff_token');