refactor(types): 重构类型系统,统一共享类型定义
feat(types): 新增共享类型中心,包含用户、产品、订单等核心领域类型 fix(types): 修复类型定义错误,统一各模块类型引用 style(types): 优化类型文件格式和注释 docs(types): 更新类型文档和变更日志 test(types): 添加类型测试用例 build(types): 配置类型共享路径 chore(types): 清理重复类型定义文件
This commit is contained in:
@@ -775,8 +775,8 @@ export class SecurityHardeningService {
|
||||
}
|
||||
}
|
||||
|
||||
private async scanCodeVulnerabilities(): Promise<any[]> {
|
||||
const vulnerabilities = [];
|
||||
private async scanCodeVulnerabilities(): Promise<Array<{ severity: string; description: string; location?: string }>> {
|
||||
const vulnerabilities: Array<{ severity: string; description: string; location?: string }> = [];
|
||||
|
||||
const sensitivePatterns = [
|
||||
{ pattern: /password\s*=\s*['"][^'"]+['"]/gi, severity: 'high', description: 'Hardcoded password' },
|
||||
@@ -788,8 +788,8 @@ export class SecurityHardeningService {
|
||||
return vulnerabilities;
|
||||
}
|
||||
|
||||
private async scanConfigurationVulnerabilities(): Promise<any[]> {
|
||||
const vulnerabilities = [];
|
||||
private async scanConfigurationVulnerabilities(): Promise<Array<{ severity: string; description: string; location?: string }>> {
|
||||
const vulnerabilities: Array<{ severity: string; description: string; location?: string }> = [];
|
||||
|
||||
const weakConfigs = [
|
||||
{ check: 'NODE_ENV === "development"', severity: 'medium', description: 'Development mode in production' },
|
||||
@@ -900,7 +900,7 @@ export class SecurityHardeningService {
|
||||
async getSecurityAlerts(): Promise<SecurityAlert[]> {
|
||||
try {
|
||||
const alerts = await this.redisService.lrange('security:alerts:latest', 0, 99);
|
||||
return alerts.map(alert => JSON.parse(alert));
|
||||
return alerts.map((alert: string) => JSON.parse(alert));
|
||||
} catch (error) {
|
||||
return [];
|
||||
}
|
||||
@@ -909,7 +909,7 @@ export class SecurityHardeningService {
|
||||
async getAuditLogs(limit: number = 100): Promise<SecurityAuditLog[]> {
|
||||
try {
|
||||
const logs = await this.redisService.lrange('security:audit:recent', 0, limit - 1);
|
||||
return logs.map(log => JSON.parse(log));
|
||||
return logs.map((log: string) => JSON.parse(log));
|
||||
} catch (error) {
|
||||
return [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user