Remove tenant parameter from APIs and admin UI (single-tenant mode)
This commit is contained in:
@@ -74,10 +74,6 @@
|
||||
<label>Contraseña</label>
|
||||
<input v-model="login.password" type="password" placeholder="••••••" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>Tenant</label>
|
||||
<input v-model="login.tenantId" placeholder="default" />
|
||||
</div>
|
||||
<button :disabled="loading" @click="loginUser">Iniciar sesión</button>
|
||||
<div :class="{ error: loginError, success: loginSuccess }">{{ loginMessage }}</div>
|
||||
|
||||
@@ -96,10 +92,6 @@
|
||||
<label>Contraseña</label>
|
||||
<input v-model="register.password" type="password" placeholder="••••••" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>Tenant</label>
|
||||
<input v-model="register.tenantId" placeholder="default" />
|
||||
</div>
|
||||
<button :disabled="loading" @click="registerUser">Registrar</button>
|
||||
<div :class="{ error: registerError, success: registerSuccess }">{{ registerMessage }}</div>
|
||||
</div>
|
||||
@@ -110,7 +102,7 @@
|
||||
<div style="display:flex; align-items:center; justify-content:space-between;">
|
||||
<div>
|
||||
<div><strong>{{ user?.name || user?.email }}</strong></div>
|
||||
<div style="font-size:0.85rem; color:#555;">Tenant: {{ tenantId }}</div>
|
||||
<div style="font-size:0.85rem; color:#555;">Tenant: unificado</div>
|
||||
</div>
|
||||
<button @click="logout">Salir</button>
|
||||
</div>
|
||||
@@ -174,15 +166,15 @@
|
||||
|
||||
const token = ref(localStorage.getItem(tokenKey) || '');
|
||||
const user = ref(null);
|
||||
const tenantId = ref('default');
|
||||
const tenantId = ref('default'); // kept for compatibility (subdomain / future use)
|
||||
const status = ref('');
|
||||
const modules = ref([]);
|
||||
const selectedModule = ref('');
|
||||
const moduleHtml = ref('');
|
||||
const loading = ref(false);
|
||||
|
||||
const login = reactive({ email: '', password: '', tenantId: 'default' });
|
||||
const register = reactive({ name: '', email: '', password: '', tenantId: 'default' });
|
||||
const login = reactive({ email: '', password: '' });
|
||||
const register = reactive({ name: '', email: '', password: '' });
|
||||
|
||||
const loginMessage = ref('');
|
||||
const loginError = ref(false);
|
||||
@@ -203,8 +195,7 @@
|
||||
setStatus('Consultando ' + path + '...');
|
||||
const headers = options.headers || {};
|
||||
if (token.value) headers.Authorization = `Bearer ${token.value}`;
|
||||
headers['x-tenant-id'] = tenantId.value || 'default';
|
||||
const res = await fetch(`${apiRoot}${path}?tenantId=${encodeURIComponent(tenantId.value)}`, {
|
||||
const res = await fetch(`${apiRoot}${path}`, {
|
||||
...options,
|
||||
headers,
|
||||
});
|
||||
@@ -236,7 +227,6 @@
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
tenantId: login.tenantId || 'default',
|
||||
email: login.email,
|
||||
password: login.password,
|
||||
}),
|
||||
@@ -270,7 +260,6 @@
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
tenantId: register.tenantId || 'default',
|
||||
name: register.name,
|
||||
email: register.email,
|
||||
password: register.password,
|
||||
|
||||
Reference in New Issue
Block a user