优化
This commit is contained in:
@@ -642,6 +642,9 @@ export class AcceptanceRun {
|
||||
this.options.fixedCustomerId ||= process.env.ADMIN_TEST_FIXED_CUSTOMER_ID || ''
|
||||
this.options.merchantUsername ||= process.env.MERCHANT_TEST_USERNAME || ''
|
||||
this.options.merchantPassword ||= process.env.MERCHANT_TEST_PASSWORD || ''
|
||||
this.options.fixedPdaActors ??= JSON.parse(process.env.ADMIN_TEST_OVERSEAS_PDA_ACTORS || '[]')
|
||||
this.options.fixedDomesticDenyActor ??= JSON.parse(process.env.ADMIN_TEST_DOMESTIC_DENY_ACTOR || 'null')
|
||||
this.options.fixedFleetResources ??= JSON.parse(process.env.ADMIN_TEST_FLEET_RESOURCES || '[]')
|
||||
}
|
||||
const markerNamespace = String(options.markerNamespace || '').replace(/[^A-Za-z0-9_-]/g, '').slice(0, 12)
|
||||
this.marker = `${options.environment === 'gray' ? 'GRAY' : 'ADMIN'}-API-${new Date().toISOString().replace(/\D/g, '').slice(0, 17)}${markerNamespace ? `-${markerNamespace}` : ''}`
|
||||
@@ -665,6 +668,7 @@ export class AcceptanceRun {
|
||||
if (this.options.environment !== 'test') return
|
||||
const pathname = new URL(path, 'https://acceptance.invalid').pathname.replace(/\/$/, '')
|
||||
if (String(method).toUpperCase() === 'POST' && (pathname === '/api/platform/v1/iam/tenants'
|
||||
|| pathname === '/api/auth/register'
|
||||
|| /^\/api\/platform\/v1\/iam\/tenants\/[^/]+\/(archive|submit-review)$/.test(pathname))) {
|
||||
throw new Error('TEST 固定客户模式禁止创建、归档客户或重提资质;请复用已配置客户')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user