fix: round-2 audit fixes — security, code quality, and UI improvements
Security (HIGH): - Normalize all Redis cache keys to lowercase (verifyCode, passwordReset) - Fix verify code TTL renewal on failed attempts: use remaining TTL via ExpiresAt field instead of resetting to full 15-minute window - Add 3 missing fields to diffSettings audit log (promo_code, invitation_code, custom_endpoints) Code quality (MEDIUM): - Extract filterVerifiedEmails shared helper (balance_notify_service.go) - Add Pricing array non-empty validation for channel pricing rules - Add platform token semantics comment in gateway_service.go - Complete validatePlanPatch test coverage (+10 test cases) - Replace string types with QuotaThresholdType/QuotaResetMode across frontend - Remove duplicate getPlatformTextColor/getRateBadgeClass in ChannelsView - Return EMAIL_NOT_FOUND error on RemoveNotifyEmail miss UI improvements: - Reorder cost tooltip: user billing above separator, account billing below - Add NaN guard to accountBilled function - Move timezone selector inline into reset-mode row (no longer standalone)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { reactive, ref } from 'vue'
|
||||
import { adminAPI } from '@/api/admin'
|
||||
import { QUOTA_THRESHOLD_TYPE_FIXED } from '@/constants/account'
|
||||
import { QUOTA_THRESHOLD_TYPE_FIXED, type QuotaThresholdType } from '@/constants/account'
|
||||
|
||||
export const QUOTA_NOTIFY_DIMS = ['daily', 'weekly', 'total'] as const
|
||||
export type QuotaNotifyDim = (typeof QUOTA_NOTIFY_DIMS)[number]
|
||||
@@ -8,7 +8,7 @@ export type QuotaNotifyDim = (typeof QUOTA_NOTIFY_DIMS)[number]
|
||||
interface DimState {
|
||||
enabled: boolean | null
|
||||
threshold: number | null
|
||||
thresholdType: string | null
|
||||
thresholdType: QuotaThresholdType | null
|
||||
}
|
||||
|
||||
export function useQuotaNotifyState() {
|
||||
@@ -34,7 +34,7 @@ export function useQuotaNotifyState() {
|
||||
for (const d of QUOTA_NOTIFY_DIMS) {
|
||||
state[d].enabled = (extra?.[`quota_notify_${d}_enabled`] as boolean) ?? null
|
||||
state[d].threshold = (extra?.[`quota_notify_${d}_threshold`] as number) ?? null
|
||||
state[d].thresholdType = (extra?.[`quota_notify_${d}_threshold_type`] as string) ?? null
|
||||
state[d].thresholdType = (extra?.[`quota_notify_${d}_threshold_type`] as QuotaThresholdType) ?? null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user