develop #1

Merged
zhangxiang merged 60 commits from develop into main 2026-04-05 10:28:15 +08:00
Showing only changes of commit 47611e55c3 - Show all commits
@@ -10,7 +10,7 @@ const SIGNATURE_SECRET = 'NovalonManageSystemSecretKey2026';
export class RoleAuthManager { export class RoleAuthManager {
private static tokenCache: Map<string, TokenCache> = new Map(); private static tokenCache: Map<string, TokenCache> = new Map();
private static readonly API_BASE_URL = process.env.VITE_API_BASE_URL || 'http://localhost:8080'; private static readonly API_BASE_URL = process.env.VITE_API_BASE_URL || 'http://localhost:8084';
private static readonly TOKEN_EXPIRY_BUFFER = 60000; private static readonly TOKEN_EXPIRY_BUFFER = 60000;
static async getRoleToken(roleName: string): Promise<string> { static async getRoleToken(roleName: string): Promise<string> {
@@ -59,13 +59,11 @@ export class RoleAuthManager {
private static async authenticateWithBackend(credentials: { username: string; password: string }): Promise<string> { private static async authenticateWithBackend(credentials: { username: string; password: string }): Promise<string> {
const path = '/api/auth/login'; const path = '/api/auth/login';
const body = JSON.stringify(credentials); const body = JSON.stringify(credentials);
const signatureHeaders = this.generateSignatureHeaders('POST', path, body);
const response = await fetch(`${this.API_BASE_URL}${path}`, { const response = await fetch(`${this.API_BASE_URL}${path}`, {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json'
...signatureHeaders
}, },
body, body,
}); });